static PagesHandler() { CustomCssUrl = Configuration.ConfigUtils.CustomCssUrl; SchedulerProvider = Configuration.ConfigUtils.SchedulerProvider; SchedulerProvider.Init(); SchedulerDataProvider = new DefaultSchedulerDataProvider(SchedulerProvider); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ISchedulerProvider provider) { provider.Init(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Home/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseSession(); app.UseCookiePolicy(); app.UseAuthentication(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); }
static PagesHandler() { ViewEngine = new VelocityViewEngine(); ViewEngine.Init(); SchedulerProvider = Configuration.ConfigUtils.SchedulerProvider; SchedulerProvider.Init(); SchedulerDataProvider = new DefaultSchedulerDataProvider(SchedulerProvider); }
static void Main() { try { //处理未捕获的异常 Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); //处理UI线程异常 Application.ThreadException += Application_ThreadException; //处理非UI线程异常 AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); ISchedulerProvider schedulerProvider = Provider.SchedulerProvider; schedulerProvider.Init(); ISchedulerDataProvider schedulerDataProvider = new DefaultSchedulerDataProvider(schedulerProvider); Application.Run(new MainForm(schedulerProvider, schedulerDataProvider)); } catch (Exception exception) { string str = GetExceptionMsg(exception, string.Empty); MessageBox.Show(str, "系统错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } }