private void frmMain_Load(object sender, EventArgs e) { using (FlightProcessorConnection cn = new FlightProcessorConnection()) { this.Text += " [" + cn.Database.Connection.Database + "]"; } _timer1.Interval = 2000; _timer1.Elapsed += new System.Timers.ElapsedEventHandler(_timerEvent1); _timer1.Enabled = true; _timer2.Interval = 2000; //every 10 second _timer2.Elapsed += new System.Timers.ElapsedEventHandler(_timerEvent2); _timer2.Enabled = true; ThreadDBActions = new Thread(new ThreadStart(fnThreadDBActions)); ThreadDBActions.IsBackground = true; ThreadDBActions.Start(); ThreadSendAlertQueue = new Thread(new ThreadStart(fnSendAlertQueue)); ThreadSendAlertQueue.IsBackground = true; ThreadSendAlertQueue.Start(); ResetFlightsGrid(); gridFlights.AutoSizeCells(); ResetNotificationGrid(); gridNotifications.AutoSizeCells(); WorkerProcess.OnTaskError += ShowExceptions; WorkerProcess.OnDbEntityException += ShowEntityErrors; WorkerProcess.StartProcessor(); }