예제 #1
0
        public static bool Init(ModuleSetting Setting, ref LanguageManager Manager, bool AddByAssembly = true)
        {
            //string json_file = SettingsHSSever.Settings.GetPath("WebRouter.json");
            bool Load;

            Controller.Init(ref Manager);
            Load = Controller.AddByAssembly(Setting.Load.Controller);

            if (Load)
            {
                //Logger.LogSYSTEM(LogLevel.INFO, LanguageManager.Language["STR_LOG_WEB_ROUTER_INITING"]);
                Middleware.Init(ref Manager);
                if (AddByAssembly)
                {
                    Load = Middleware.AddByAssembly(Setting.Load.MiddleWare);
                }
            }

            if (Load)
            {
                Router.Init(ref Manager);
                if (AddByAssembly)
                {
                    Load = Router.AddByAssembly(Setting.Load.Module);
                }
                //Logger.LogSYSTEM(LogLevel.INFO, LanguageManager.Language["STR_LOG_WEB_ROUTER_INITED"]);
            }

            if (Load)
            {
                WebSocketRouter.Init(ref Manager);
                if (AddByAssembly)
                {
                    Load = WebSocketRouter.AddByAssembly(Setting.Load.Module);
                }
            }

            return(Load);
        }