private void HostingForm_Load(object sender, EventArgs e) { try { _host = new ServiceHost(typeof(VentsService)); _host.Open(); Connection.ConnectionString(); labelRun.Text = @"Работает..."; toolStripMenuRunService.Enabled = false; BtnStart.Enabled = false; _classOdTasks = new ClassOfTasks(); _classOdTasks.OnNewMessageChataData += OnNewMessage; LoadMessages(); //myTimer.Tick += new EventHandler(TimerEventProcessor); ////myTimer.Interval = 5000; //myTimer.Start(); //// Runs the timer //while (exitFlag == false) //{ // Application.DoEvents(); //} //myTimer.Stop(); } catch (Exception ex) { MessageBox.Show(ex.Message + @": " + ex.TargetSite +@": " + ex.Source); } }
private void HostingForm_Load(object sender, EventArgs e) { try { _host = new ServiceHost(typeof(VentsService)); _host.Open(); Connection.ConnectionString(); labelRun.Text = @"Работает..."; toolStripMenuRunService.Enabled = false; BtnStart.Enabled = false; _classOdTasks = new ClassOfTasks(); _classOdTasks.OnNewMessageChataData += OnNewMessage; LoadMessages(); //myTimer.Tick += new EventHandler(TimerEventProcessor); ////myTimer.Interval = 5000; //myTimer.Start(); //// Runs the timer //while (exitFlag == false) //{ // Application.DoEvents(); //} //myTimer.Stop(); } catch (Exception ex) { MessageBox.Show(ex.Message + @": " + ex.TargetSite + @": " + ex.Source); } }
private void BtnStart_Click(object sender, EventArgs e) { try { _host.Close(); _host = new ServiceHost(typeof(VentsService)); _host.Open(); _classOdTasks = new ClassOfTasks(); _classOdTasks.OnNewMessageChataData += new ClassOfTasks.NewMessage(OnNewMessage); LoadMessages(); labelRun.Text = @"Работает..."; toolStripMenuRunService.Enabled = false; BtnStart.Enabled = false; } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void StartProcess() { var c = new ClassOfTasks(); c.Taskes(); }