コード例 #1
0
        internal AcwApplicationBase(
            [NotNull] Type startupModuleType,
            [NotNull] IServiceCollection services,
            [CanBeNull] Action <AcwApplicationCreationOptions> optionsAction)
        {
            Check.NotNull(startupModuleType, nameof(startupModuleType));
            Check.NotNull(services, nameof(services));

            StartupModuleType = startupModuleType;
            Services          = services;

            services.TryAddObjectAccessor <IServiceProvider>();

            var options = new AcwApplicationCreationOptions(services);

            optionsAction?.Invoke(options);

            services.AddSingleton <IAcwApplication>(this);
            services.AddSingleton <IModuleContainer>(this);

            services.AddCoreServices();
            services.AddCoreAcwServices(this);

            Modules = LoadModules(services, options);
        }
コード例 #2
0
 protected virtual void SetAcwApplicationCreationOptions(AcwApplicationCreationOptions options)
 {
 }
コード例 #3
0
 private IReadOnlyList <IAcwModuleDescriptor> LoadModules(IServiceCollection services, AcwApplicationCreationOptions options)
 {
     return(services
            .GetSingletonInstance <IModuleLoader>()
            .LoadModules(
                services,
                StartupModuleType,
                options.PlugInSources
                ));
 }