private void PrintDeviceInfo(string aPrologue, ControlPoint.CpDevice aDevice) { string location; aDevice.GetAttribute("Upnp.Location", out location); string friendlyName; aDevice.GetAttribute("Upnp.FriendlyName", out friendlyName); Console.Write(aPrologue + "\n udn = " + aDevice.Udn() + "\n location = " + location + "\n name = " + friendlyName + "\n"); }
private void DeviceRemoved(ControlPoint.CpDeviceList aList, ControlPoint.CpDevice aDevice) { lock (this) { if (!iListFrozen) { PrintDeviceInfo("Removed", aDevice); string udn = aDevice.Udn(); int count = iDeviceList.Count; for (int i = 0; i < count; i++) { if (iDeviceList[i].Udn() == udn) { iDeviceList[i].RemoveRef(); iDeviceList.RemoveAt(i); break; } } } } }