Simple event-based library which is provide easy way to get events from Elite: Dangerous log journal.
Use AddEliteDangerousAPI()
method to add API into your app:
// Use Microsoft.Extensions.DependencyInjection
var serviceProvider = new ServiceCollection()
.AddLogging(cfg => cfg.AddConsole())
.Configure<LoggerFilterOptions>(cfg => cfg.MinLevel=LogLevel.Debug)
.AddEliteDangerousAPI()
.BuildServiceProvider();
// Get instance from DI
var api = serviceProvider.GetService<IEliteDangerousAPI>()
// Subscribe to all events or find events which you interested for.
api.AllEvents += (s, e) => Console.WriteLine($"API event at {e.Event.Timestamp:O} {e.EventName} type {e.EventType.Name}");
// Run api (you could define autostart in ApiOptions)
api.Start()
Console.ReadLine();
// Stop processing if you want
api.Stop()