예제 #1
0
        /// <summary>
        /// MVC appliction start event
        /// </summary>
        protected void Application_Start()
        {
            // Register areas and routes
            AreaRegistration.RegisterAllAreas();

            UMClientConfig.Register();
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            WebApiConfig.Register(GlobalConfiguration.Configuration);

            // Register global filters
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);

            // Register scripts and css bundles
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            // Register unity configuration
            BootstrapConfig.Register();

            //Register providers
            ProvidersConfig.Register();

            // Register custom flag enum model binder
            ModelBinders.Binders.DefaultBinder = new CustomModelBinder();

            AsyncManagerConfig.Register();

            ActiveSessionManager.StartTimer(spanTicks: TimeSpan.FromHours(6).Ticks); // token expire time is 6 hours
        }
예제 #2
0
        private void ShowMode()
        {
            BootstrapConfig config = (target as BootstrapConfig);
            int             index  = 0;

            switch (config.StartupWorld)
            {
            case TargetWorld.ClientAndServer:
                index = 2;
                break;

            case TargetWorld.Server:
                index = 1;
                break;
            }

            index = EditorGUILayout.Popup("Mode", index, options);

            switch (index)
            {
            case 2:
                _startupWorldProp.intValue = (int)TargetWorld.ClientAndServer;
                break;

            case 1:
                _startupWorldProp.intValue = (int)TargetWorld.Server;
                break;

            case 0:
                _startupWorldProp.intValue = (int)TargetWorld.Client;
                break;
            }
        }
예제 #3
0
        /// <summary>
        /// MVC appliction start event
        /// </summary>
        protected void Application_Start()
        {
            // Register areas and routes
            AreaRegistration.RegisterAllAreas();

            UMClientConfig.Register();
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            WebApiConfig.Register(GlobalConfiguration.Configuration);

            // Register global filters
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);

            // Register scripts and css bundles
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            // Register unity configuration
            BootstrapConfig.Register();

            //Register providers
            ProvidersConfig.Register();

            // Register custom flag enum model binder
            ModelBinders.Binders.DefaultBinder = new CustomModelBinder();

            AsyncManagerConfig.Register();
        }
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            MappingConfig.RegisterMapping();

            container = new WindsorContainer();
            BootstrapConfig.Register(this.container);
        }
예제 #5
0
#pragma warning restore 649

        #endregion

        #region Methods

        public void Boot(BootstrapConfig bootstrapConfig)
        {
            if (bootstrapConfig == null || !bootstrapConfig.AddMainMenu)
            {
                return;
            }
            if (_menuLoaders == null)
            {
                return;
            }
            foreach (var loader in _menuLoaders.Where(l => !l.Value.IsLoaded))
            {
                loader.Value.Load();
            }
        }
예제 #6
0
        public void Boot(BootstrapConfig bootstrapConfig)
        {
            if (!bootstrapConfig.AddMainMenu) return;
            var menuContentRegion = MagicStrings.RegionNames.PUPPY_MAIN_MENU_CONTENT_REGION;

            if (bootstrapConfig.IsUsingCustomShell)
            {
                if (!RegionManager.Regions.ContainsRegionWithName(menuContentRegion))
                {
                    Logger.Log("MainMenu content region missing for custom shell", Category.Exception);
                    throw new InvalidOperationException(string.Format(Resources._noMainMenuContentRegionException, menuContentRegion));
                }
            }

            RegionManager.RegisterViewWithRegion(menuContentRegion, typeof (MainMenuView));
            Logger.Log("Added MainMenu to region {RegionName:l}", Category.Info, null, menuContentRegion);
            Logger.Log("Finished booting {ClassName:l}", Category.Info, null, GetType().FullName);
        }
예제 #7
0
    protected override BootstrapConfig GetBootstrapConfig()
    {
        BootstrapConfig config = base.GetBootstrapConfig();

        string path = Path.Combine(Application.streamingAssetsPath, "App.json");

        if (File.Exists(path))
        {
            string    cfgStr    = File.ReadAllText(path);
            AppConfig appConfig = JsonUtility.FromJson <AppConfig>(cfgStr);
            string    useServer = appConfig.ServerList[appConfig.UseServer];
            Debug.Log($"UseServer:{useServer}");
            string[] ips = useServer.Split(':');
            config.IP   = ips[0];
            config.Port = ushort.Parse(ips[1]);
        }

        return(config);
    }
 private static void RegisterConfigTypes(ContainerBuilder containerBuilder)
 {
     //FaraConfig is already registered (EngineContext)
     //containerBuilder.RegisterInstance(FaraConfig.Load()).As<FaraConfig>().SingleInstance();
     containerBuilder.Register(cc => BootstrapConfig.Load()).AsSelf().SingleInstance();
 }
예제 #9
0
 public UserInstaller(BootstrapConfig bootstrapConfig)
 {
     _bootstrapConfig = bootstrapConfig;
 }