示例#1
0
        public void Dispose()
        {
            if (samplingTimer != null)
            {
                samplingTimer.Stop();
                samplingTimer.Enabled = false;
                samplingTimer.Dispose();
            }

            if (commPort != null)
            {
                commPort.Close();
                commPort.Dispose();
            }
        }
示例#2
0
 private void buttonStop_Click(object sender, System.EventArgs e)
 {
     _comPort.Close();
     EnablePortControls();
 }