示例#1
0
 public void Configuration(IAppBuilder app)
 {
     AppInitializer.Initalize(new AppServicesInit());
     app.UseCors(CorsOptions.AllowAll);
     ConfigureOAuth(app);
     ConfigureWebApi(app);
 }
示例#2
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            AppInitializer.Initalize(new WpfAppInit());

            LoginView           vwLogin    = DI.DefaultServiceProvider.GetService <LoginView>();
            NameValueCollection parameters = new NameValueCollection();

            parameters.Add(ViewParams.Mode.Param, ViewParams.Mode.Popup);
            ViewModel.NavigateTo(DI.DefaultServiceProvider.GetService <LoginViewModel>(), vwLogin, parameters, null, null);
        }
示例#3
0
        /// <summary>
        /// Constructs a new DefaultServiceProviderHostFactory and ensures the app is initialized
        /// </summary>
        public DefaultServiceProviderHostFactory()
        {
            if (DI.DefaultServiceProvider != null)
            {
                return;
            }
            const string CfgAppInit = "xomfwk:AppInitializer";
            Type         initType   = AppInitializer.GetType(ConfigurationManager.AppSettings[CfgAppInit]);

            if (initType == null)
            {
                throw new ApplicationException("Cannot instantiate DI application initializer. Make sure you set the "
                                               + CfgAppInit + " config to a subclass of the AppInitalizer with a default constructor.");
            }
            AppInitializer.Initalize(Activator.CreateInstance(initType) as AppInitializer);
        }
示例#4
0
文件: Startup.cs 项目: ksharma7/Test
 public void Configuration(IAppBuilder app)
 {
     AppInitializer.Initalize(new WebAppInit());
     app.Use <DIMiddleware>();
     ConfigureAuth(app);
 }