Пример #1
0
 private void DeviceAdded(object sender, DeviceChangeEventArgs e)
 {
     if ((e.Type == INTV.Core.Model.Device.ConnectionType.Serial) && DeviceChange.IsDeviceChangeFromSystem(e.State))
     {
         var acceptPort = IsNotExclusivePort(Connection.CreatePseudoConnection(e.Name, ConnectionType.Serial));
         if (acceptPort && !SerialPorts.Any(p => p.PortName == e.Name))
         {
             SerialPorts.Add(new SerialPortViewModel(e.Name));
         }
         INTV.Shared.ComponentModel.CommandManager.InvalidateRequerySuggested();
     }
     RaisePropertyChanged("IsPortValid");
 }