public static IApp CreateApp()
        {
            var configService = new ConfigService(new FilesConfigProvider("./Config", "yaml"), new YamlConfigSerializer());

            if (configService.Get <AppConfig>().Modules.Count == 0)
            {
                configService.Get <AppConfig>().Modules.Add(ModuleConfigElement.Create <WebAppInitializerModule>());
            }

            var app = AppBrix.App.Create(configService);

            app.Start();
            return(app);
        }
Example #2
0
 public ModuleInfo(IModule module, ModuleConfigElement config)
 {
     this.Module = module;
     this.Config = config;
     this.Status = config.Status;
 }
Example #3
0
 private IModule CreateModule(ModuleConfigElement element) => Type.GetType(element.Type).CreateObject <IModule>();
Example #4
0
 /// <summary>
 /// Creates a default application with a specified configuration service.
 /// Registers the provided module type in the <see cref="AppConfig"/>.
 /// </summary>
 /// <typeparam name="T">Type of the <see cref="MainModuleBase"/> to be registered.</typeparam>
 /// <param name="configService">The configuration service.</param>
 /// <returns>The created app.</returns>
 public static IApp Create <T>(IConfigService configService) where T : MainModuleBase, new()
 {
     configService.Get <AppConfig>().Modules.Add(ModuleConfigElement.Create <T>());
     return(App.Create(configService));
 }
 private IModule CreateModule(ModuleConfigElement element)
 {
     return Type.GetType(element.Type).CreateObject<IModule>();
 }
Example #6
0
 private IModule CreateModule(ModuleConfigElement element)
 {
     return(Type.GetType(element.Type).CreateObject <IModule>());
 }