Ejemplo n.º 1
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            var unityConfigurator = new UnityConfigurator();
            var container         = unityConfigurator.GetConfiguredContainer();

            var mainWindow = (MainWindow)container.Resolve(typeof(MainWindow), "MainWindow");

            mainWindow.Show();
        }
        public static void Configure(IGlobalConfiguration httpConfiguration, IAppBuilder app)
        {
            var container = UnityConfigurator.GetConfiguredContainer();

            httpConfiguration.UseActivator(new ContainerJobActivator(container));

            app.UseHangfireAspNet(GetHangfireServers);

            if (AppSettingsService.Environment.IsDev())
            {
                // If we are in Dev, always allow Hangfire access.
                app.UseHangfireDashboard("/hangfire");
            }
            else
            {
                app.UseHangfireDashboard("/hangfire", new DashboardOptions
                {
                    Authorization = new[] { new InventAppHangfireDashboardAuthorizationFilter() }
                });
            }
        }