public virtual void Stop() { Running = false; if (ConnectionThread != null) { ConnectionThread.Abort(); } }
public void Disconnect() { if (this.ConnectionThread.ThreadState == ThreadState.Running) { ConnectionThread.Abort(); } this.IsTerminated = true; this.Connection.Disconnect(); }
protected override void AfterMyWorkStateChanged(object sender, EventArgs e) { if (myWorkState) { ConnectionThread = new System.Threading.Thread(Connection_Mysql); ConnectionThread.Start(); } else { if (ConnectionThread != null) { ConnectionThread.Abort(); } } }
protected override void AfterMyWorkStateChanged(object sender, EventArgs e) { if (myWorkState) { CaseSettings = ChungHsin_MySqlMethod.CaseLoad(); ReceiveSettings = ChungHsin_MySqlMethod.ReceiveLoad(); DeviceConfigs = ChungHsin_MySqlMethod.DevicesLoad(); ConnectionThread = new Thread(Connection_Mysql); ConnectionThread.Start(); } else { if (ConnectionThread != null) { ConnectionThread.Abort(); } } }
protected override void AfterMyWorkStateChanged(object sender, EventArgs e) { if (myWorkState) { CaseSettings = Ewatch_MySqlMethod.CaseLoad(); AiSettings = Ewatch_MySqlMethod.AiLoad(); ElectricSettings = Ewatch_MySqlMethod.ElectricLoad(); ConnectionThread = new Thread(Connection_Mysql); ConnectionThread.Start(); } else { if (ConnectionThread != null) { ConnectionThread.Abort(); } } }