private List <RemoteStopAudioOutputCode> listRemoteStopAudioOutputCode() { var list = new List <RemoteStopAudioOutputCode>(); for (int i = 0; i < dgvRemote.Rows.Count; i++) { if (dgvRemote.Rows[i].Cells["isAccept"].Value.ToString() == "否") { continue; } var DestMac = dgvRemote.Rows[i].Cells["MAC"].Value.ToString(); if (list.Any(l => l.DestMac == DestMac)) { continue; } var code = new RemoteStopAudioOutputCode() { Guid = this.Guid, SrcMac = Setting.authorizationInfo.MachineCode, SrctetName = this.ucTextBoxEx1.Text, DestStetName = dgvRemote.Rows[i].Cells["StetName"].Value.ToString(), DestMac = dgvRemote.Rows[i].Cells["MAC"].Value.ToString() }; list.Add(code); } return(list); }
public void HandleMessage(RemoteStopAudioOutputCode message) { if (this.IsDisposed || this.Disposing) { return; } if (message.Guid != this.Guid) { return; } this.Invoke(new MethodInvoker(() => { var rows = this.DgvTable.Select("MAC='" + Setting.authorizationInfo.MachineCode + "'"); foreach (DataRow row in rows) { var stetName = row["StetName"] + ""; Mediator.ShowMsg(string.Format("远程听诊停止接收数据,编号为{0}", this.Guid)); var stethoscopeArr = StethoscopeManager.StethoscopeList.Where(s => s.Name == stetName); if (!stethoscopeArr.Any()) { throw new Exception("目前没有检测到听诊器,请检测设备设置!"); } var stethoscope = stethoscopeArr.First(); if (!stethoscope.IsConnected) { Mediator.ShowMsg(string.Format("听诊器 {0} 尚未连接", stethoscope.Name)); return; } else { stethoscope.StopAudioOutput(); } } })); IsReceived = false; }