/// <summary> /// 推出程序 /// </summary> public void Exit() { MyView.Exit(); MyModel.Exit(); MyView.FlushListBox(ref MyModel); Application.Exit(); }
/// <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"); } }
/// <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"); } }
/// <summary> /// 加载配置文件 /// </summary> public void LoadConf() { MyModel.LoadConf(f); MyView.FlushListBox(ref MyModel); }
/// <summary> /// 保存配置文件 /// </summary> public void SaveConf() { MyModel.SaveConf(); MyView.FlushListBox(ref MyModel); }
/// <summary> /// 删除串口 /// </summary> public void DelPort() { MyModel.DelPort(f); MyView.FlushListBox(ref MyModel); }