Example #1
0
 private void btnRun_Click(object sender, EventArgs e)
 {
     // When button1 clicked, start operation and open serial port
     SerialPortManager.ReturnValue    = string.Empty;
     SerialPortManager.IsFirstSending = true;
     SerialPortManager.Open();
 }
Example #2
0
 private void Spm_OnMessageReceived(string message, bool isCompleted, bool isSuccess)
 {
     richTextBox1.AppendText(message);
     if (isCompleted)
     {
         SerialPortManager.Close();
         if (isSuccess)
         {
             // Do somethings here
             MessageBox.Show("Operation succeeded!");
         }
         else
         {
             // Do somethings here
             MessageBox.Show("Operation failed");
         }
         // Finish process here or restart
     }
 }
Example #3
0
 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     SerialPortManager.Close();
 }