protected override void AfterInitialized() { base.AfterInitialized(); cbStati.Items.Clear(); foreach (EMailState v in Enum.GetValues(typeof(EMailState))) { cbStati.Items.Add(new ComboboxItem <EMailState>(v, v.DescriptionAttr())); } cbStati.SelectedIndex = 0; SetNodeSelectionEvidenceIntreeview(treeView1); _scheduler = new JobsScheduler(AppRepo, AppSvc); _scheduler.OnSentMailEvent += OnSentMailEvent; var jobs = AppRepo.GetJobs().OrderBy(x => x.Nome.ToLower()); AddNodes(jobs); if (treeView1.Nodes.Count > 0) { treeView1.SelectedNode = treeView1.Nodes[0]; } else { treeView1_AfterSelect(this, null); } }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IJobsScheduler scheduler) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } scheduler.ScheduleRecurringJobs(); app.UseStaticFiles(); app.UseCors(o => o.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader()); app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint("../swagger/v1/swagger.json", "GenieThings Dashboard API"); }); app.UseHangfireDashboard("/hangfire", new DashboardOptions { Authorization = new[] { new AuthorizationFilter() } }); app.UseRouting(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); }
public override void OnClosing() { base.OnClosing(); _scheduler.Dispose(); _scheduler = null; }