Пример #1
0
 public OptionsProvider(IServiceProvider services)
 {
     _fileReader = services.GetRequiredService <IFileReader>();
     _config     = services.GetRequiredService <IConfiguration>();
     _log        = services.GetRequiredService <ILogger <JournalProvider> >();
     _codeConfig = services.GetRequiredService <IEliteDangerousApiConfiguration>();
 }
Пример #2
0
        /// <summary>
        /// Creates a new EliteDangerousAPI class
        /// </summary>
        /// <param name="services"> ServiceProvider </param>
        public EliteDangerousApi(IServiceProvider services)
        {
            try
            {
                _log = services.GetRequiredService <ILogger <EliteDangerousApi> >();

                Events     = services.GetRequiredService <EventHandler>();
                Ship       = services.GetRequiredService <IShip>();
                Commander  = services.GetRequiredService <ICommander>();
                NavRoute   = services.GetRequiredService <INavRoute>();
                Cargo      = services.GetRequiredService <ICargo>();
                Market     = services.GetRequiredService <IMarket>();
                Modules    = services.GetRequiredService <IModules>();
                Backpack   = services.GetRequiredService <IBackpack>();
                Shipyard   = services.GetRequiredService <IShipyard>();
                Outfitting = services.GetRequiredService <IOutfitting>();
                Bindings   = services.GetRequiredService <IBindings>();

                Version = Assembly.GetExecutingAssembly().GetCustomAttribute <AssemblyInformationalVersionAttribute>()
                          .InformationalVersion.Split('+')[0];

                _config     = services.GetRequiredService <IConfiguration>();
                _codeConfig = services.GetRequiredService <IEliteDangerousApiConfiguration>();

                _eventProvider   = services.GetRequiredService <IEventProvider>();
                _eventProcessors = services.GetRequiredService <IEnumerable <IEventProcessor> >();

                _journalDirectoryProvider = services.GetRequiredService <IJournalDirectoryProvider>();

                _journalProvider  = services.GetRequiredService <IJournalProvider>();
                _journalProcessor = services.GetRequiredService <IJournalProcessor>();

                _statusProvider  = services.GetRequiredService <IStatusProvider>();
                _statusProcessor = services.GetRequiredService <IStatusProcessor>();

                _optionsDirectoryProvider = services.GetRequiredService <IOptionsDirectoryProvider>();
                _optionsProvider          = services.GetRequiredService <IOptionsProvider>();
                _optionsProcessor         = services.GetRequiredService <IOptionsProcessor>();
            }
            catch (Exception ex)
            {
                PreInitializationException = ex;
            }
        }
Пример #3
0
 public OptionsDirectoryProvider(ILogger <IOptionsDirectoryProvider> log, IConfiguration config, IEliteDangerousApiConfiguration codeConfig)
 {
     _log        = log;
     _config     = config;
     _codeConfig = codeConfig;
 }
Пример #4
0
 public JournalDirectoryProvider(IServiceProvider services)
 {
     _log        = services.GetRequiredService <ILogger <JournalProvider> >();
     _config     = services.GetRequiredService <IConfiguration>();
     _codeConfig = services.GetRequiredService <IEliteDangerousApiConfiguration>();
 }