Exemple #1
0
        private void _InitializeForStandaloneApplication()
        {
            if (Config.ApplicationMode != HostApplicationMode.Shared)
            {
                Container.Unregister(Container.FindComponent(typeof(IFileNameResolver), ""));
                Container.Register(
                    Container.NewComponent <IFileNameResolver, HostFileNameResolver>(
                        implementation: new HostFileNameResolver(this)));
                Container.Register(Container.NewComponent <IMvcContext, HostMvcContext>());
                Container.Unregister(Container.FindComponent(typeof(IAction), "_sys.login.action"));
                Container.Unregister(Container.FindComponent(typeof(IAction), "_sys.logout.action"));
                Container.Register(Container.NewComponent <IHostConfigProvider, HostServer>(implementation: this));

                var logger = (BaseLogger)ConsoleLogWriter.CreateLogger(
                    level: Config.LogLevel,
                    customFormat: "${Level} ${Time} ${Message}"
                    );
                logger.Mask = "*";

                Application.Container.Register(Container.NewComponent <ILogger, BaseLogger>(implementation: logger));

                Application.PerformAsynchronousStartup();
            }
        }