private void UpdateStatistics(string name, byte id, bool tx, bool rx) { Statistics nameStat = null; foreach (Statistics stat in DetectedDevices) { if (stat.Name == name) { nameStat = stat; break; } } if (nameStat == null) { nameStat = new Statistics(name, id); DetectedDevices.Add(nameStat); } if (tx) { nameStat.TxCount++; } if (rx) { nameStat.RxCount++; } }
void DeviceDiscovered(object sender, DeviceEventArgs e) { if (!String.IsNullOrWhiteSpace(e.Device.Name)) { DetectedDevices.Add(e.Device); } }
public void UpdateList() { DetectedDevices.Clear(); foreach (IDevice device in _adapter.DiscoveredDevices) { DetectedDevices.Add(device); } }
private void OnDeviceDetected(object sender, DeviceModel model) { if (DetectedDevices.Any(d => d.Id == model.Id || d.Name == model.Name)) { return; } DetectedDevices.Add(model); }
public MirandaViewModel() { if (this.IsInDesignMode()) { NoDevicesDetected = false; DetectedDevices.Add(new DeviceDataViewModel { ActualDescription = new DeviceDescription { DeviceName = "Pharos", IpAddress = "192.168.11.251", MacAddress = "11:22:33:44:55:66", NetworkMode = "StaticIp", SerialNumber = "PH123456", SubnetMask = "255.255.255.0", GatewayAddress = "192.168.1.1" } }); } }