public void UpdatedTargetPort(SerialportWatcher.PortInfo aChangedPort, bool aInserted) { if (aInserted) { if (MatchPort(aChangedPort)) { this.CurrentPort = aChangedPort; } else // 좀 더 정밀 검사.. 전체에 대해서. { foreach (var port in SerialportWatcher.Ports) { if (MatchPort(port)) { this.CurrentPort = port; break; } } } } else // remove { if (!SerialportWatcher.Ports.Any(x => x.Name == _curPort.Name)) { CurrentPort = null; } } }
public bool MatchPort(SerialportWatcher.PortInfo aPort) { if ((aPort.Kind == SerialportWatcher.PortKind.Diagnostic || aPort.Kind == SerialportWatcher.PortKind.QDLoader) && (aPort.MatchPath(this._qlloadPort) || aPort.MatchPath(this._diagPort)) ) { return(true); } return(false); }
private void SerialportWatcher_SerialPortsChangedEvent(bool aInserted, SerialportWatcher.PortInfo aChangedPort) { if (aInserted && aChangedPort.Kind == SerialportWatcher.PortKind.QDLoader) { this.UIThread(delegate { this.DialogResult = true; this.Close(); }); } }