private void btnStartSTop_Click(object sender, EventArgs e) { if (btnStartSTop.Text == "Start") { EmmaMysqlClient.EmmaServer[] servers = EmmaMysqlClient.GetServersFromConfig(); foreach (EmmaMysqlClient.EmmaServer srv in servers) { EmmaMysqlClient cli = new EmmaMysqlClient(srv.Host, 3309, srv.User, srv.Pw, srv.DB, m_CompetitionID, false, m_disableTotalCalculation); m_Clients.Add(cli); cli.OnLogMessage += new LogMessageDelegate(cli_OnLogMessage); cli.Start(); } m_Parser.Start(); btnStartSTop.Text = "Stop"; #if _CASPARCG_ casparForm = new CasparControlFrm(); casparForm.Show(); casparForm.SetEmmaClient(m_Clients[0]); #endif } else { foreach (EmmaMysqlClient cli in m_Clients) { cli.Stop(); } m_Parser.Stop(); btnStartSTop.Text = "Start"; } }
private void btnStartSTop_Click(object sender, EventArgs e) { if (btnStartSTop.Text == "Start") { EmmaMysqlClient.EmmaServer[] servers = EmmaMysqlClient.GetServersFromConfig(); foreach (EmmaMysqlClient.EmmaServer srv in servers) { EmmaMysqlClient cli = new EmmaMysqlClient(srv.host, 3309, srv.user, srv.pw, srv.db, m_CompetitionID); m_Clients.Add(cli); cli.OnLogMessage += new LogMessageDelegate(cli_OnLogMessage); cli.Start(); } m_Parser.Start(); btnStartSTop.Text = "Stop"; } else { foreach (EmmaMysqlClient cli in m_Clients) { cli.Stop(); } m_Parser.Stop(); btnStartSTop.Text = "Start"; } }