/// <summary> /// 确认按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Confirm_Click(object sender, RoutedEventArgs e) { if (CheckData()) { PassPortImpl.GetInstance().GetPort(new PortModel(portCombo.Text, baudCombo.Text, parityCombo.Text, dataCombo.Text, stopCombo.Text)); Close(); } else { MessageBox.Show("参数不得为空!"); } }
public MainWindow() { InitializeComponent(); DataForward.Instance.StartService(); InitBottomInfo(); measureMgr = MeasureMgrImpl.Instance; specDataSave = SpecDataSave.Instance; InitPage(); VocsCollectBtn_Click(null, null); PassPortImpl.GetInstance().PassValueEvent += new PassPortDelegate(ReceievedValues); DataForward.Instance.ReadDeviceNo += new DataForwardDelegate(SetDeviceNo); ExceptionUtil.Instance.LogEvent += new ExceptionDelegate(ShowLogMsg); ExceptionUtil.Instance.ExceptionEvent += new ExceptionDelegate(ShowExceptionMsg); ExceptionUtil.Instance.ShowLoadingAction += ShowLoading; }