private void HandleRemovedDevice(UPnPInternalSmartControlPoint sender, UPnPDevice device) { if ((this.OnRemovedDevice != null) || (this.OnRemovedService != null)) { ArrayList list = new ArrayList(); ArrayList list2 = new ArrayList(); Hashtable hashtable = new Hashtable(); bool flag = true; for (int i = 0; i < this.PartialMatchFilters.Length; i++) { object[] objArray; string filter = this.PartialMatchFilters[i]; double version = this.MinimumVersion[i]; if (!this.CheckDeviceAgainstFilter(filter, version, device, out objArray)) { flag = false; break; } foreach (object obj2 in objArray) { if (obj2.GetType().FullName == "Intel.UPNP.UPnPDevice") { list.Add((UPnPDevice)obj2); if ((this.PartialMatchFilters.Length == 1) && (this.OnRemovedDevice != null)) { this.OnRemovedDevice(this, (UPnPDevice)obj2); } } else { list2.Add((UPnPService)obj2); if ((this.PartialMatchFilters.Length == 1) && (this.OnRemovedDevice != null)) { this.OnRemovedDevice(this, (UPnPDevice)obj2); } } } } if (flag) { if (this.PartialMatchFilters.Length == 1) { if (this.OnRemovedService != null) { foreach (UPnPService service in list2) { this.OnRemovedService(this, service); } } return; } foreach (UPnPDevice device2 in list) { bool flag2 = true; foreach (string str2 in this.PartialMatchFilters) { if ((device2.GetDevices(str2).Length == 0) && (device2.GetServices(str2).Length == 0)) { flag2 = false; goto Label_01D8; } } Label_01D8: if (flag2) { hashtable[device2] = device2; } } foreach (UPnPService service2 in list2) { bool flag3 = true; foreach (string str3 in this.PartialMatchFilters) { if (service2.ParentDevice.GetServices(str3).Length == 0) { flag3 = false; break; } } if (flag3 && !hashtable.ContainsKey(service2.ParentDevice)) { hashtable[service2.ParentDevice] = service2.ParentDevice; } } } IDictionaryEnumerator enumerator = hashtable.GetEnumerator(); while (enumerator.MoveNext()) { if (this.OnRemovedDevice != null) { this.OnRemovedDevice(this, (UPnPDevice)enumerator.Value); } } } }
private void HandleUpdatedDevice(UPnPInternalSmartControlPoint sender, UPnPDevice device) { }
private void HandleExpiredDevice(UPnPInternalSmartControlPoint sender, UPnPDevice device) { this.HandleRemovedDevice(sender, device); }