//Arun Geo Thomas private void btnStopOpertion_Click(object sender, EventArgs e) { if (serialPortManager != null) { Object thisLock = new Object(); lock (thisLock) { readSerialPortData = false; } if (serialPortManager.CloseConnection()) { JSTimer.Stop(); lblSerialportMessages.Text = "Disconnected"; cbCOMPortsSelector.Enabled = true; btnStartOperation.Enabled = true; serialPortManager = null; } else { lblSerialportMessages.Text = "Already Disconnected"; } } else { lblSerialportMessages.Text = "No valid connection"; } ClearUI(); }
private void BtnClose_Click(object sender, EventArgs e) { SerialPortManager.CloseConnection(); ManageInputs(SystemEvents.Close); }