示例#1
0
 /// <summary>
 /// 关闭串口
 /// </summary>
 public void ClosePort()
 {
     if (!String.IsNullOrEmpty(f.PortID.Text))
     {
         if (MyModel.ClosePort(f.PortID.Text, f))
         {
             MyView.FlushListBox(ref MyModel);
             MyView.FlushX(false);
         }
         else
         {
             MessageBox.Show("Can not close port", "Error");
         }
     }
     else
     {
         MessageBox.Show("Add PortID to specific", "Inform");
     }
 }
示例#2
0
 /// <summary>
 /// 打开串口
 /// </summary>
 public void OpenPort()
 {
     //String PortID = f.PortID.Text;
     if (!String.IsNullOrEmpty(f.PortID.Text))
     {
         if (MyModel.OpenPort(f.PortID.Text, f))
         {
             MyView.FlushListBox(ref MyModel);
             MyView.FlushX(true);
         }
         else
         {
             MessageBox.Show("Flush error", "Error");
         }
     }
     else
     {
         MessageBox.Show("Add PortID to specific", "Inform");
     }
 }
示例#3
0
 /// <summary>
 /// 激活串口
 /// </summary>
 public void ActivePort()
 {
     MyView.FlushX(false);
 }