/// <summary> /// /// </summary> public void Dispose() { try { watcher.Enabled = false; watcher.Dispose(); NICList.Clear(); } catch (Exception x) { RaiseMessageError(x); } }
/// <summary> /// /// </summary> protected void SearchForPhysicalDevices() { try { NICList.Clear(); foreach (EventRecord evento in _LogEntries) { if (evento.Properties.Count > 0) { string idDevice = evento.Properties.Count > Cfg.PropertyIndex ? evento.Properties[Cfg.PropertyIndex].Value.ToString() : "Unknow"; #if DEBUG if (NICList.Contains(new NICItem() { DeviceId = idDevice }) == false) #else if (NICList.Count < 2 && NICList.Contains(new NICItem() { DeviceId = idDevice }) == false) #endif { NICList.Add(new NICItem() { DeviceId = idDevice, Status = LanStatus.Down /*, Index = Index++*/ }); } } } int Index = 0; NICList = NICList.OrderBy(lan => lan.DeviceId).ToList(); NICList.ForEach(i => { i.Index = Index++; }); } catch (Exception x) { RaiseMessageError(x); } }