public void Dispose() { if (samplingTimer != null) { samplingTimer.Stop(); samplingTimer.Enabled = false; samplingTimer.Dispose(); } if (commPort != null) { commPort.Close(); commPort.Dispose(); } }
private void buttonStop_Click(object sender, System.EventArgs e) { _comPort.Close(); EnablePortControls(); }