private void DeviceAdded(CpDeviceList aList, CpDevice aDevice) { lock (this) { PrintDeviceInfo("Added", aDevice); aDevice.AddRef(); iDeviceList.Add(aDevice); } }
protected static void Removed(IntPtr aPtr, uint aHandle) { CpDevice device = new CpDevice(aHandle); GCHandle gch = GCHandle.FromIntPtr(aPtr); CpDeviceList list = (CpDeviceList)gch.Target; if (list.iRemoved != null) { list.iRemoved(list, device); } }
private void DeviceAdded(CpDeviceList aList, CpDevice aDevice) { lock (this) { if (aDevice.Udn() == DeviceBasic.gDeviceName) { aDevice.AddRef(); iDeviceList.Add(aDevice); } } }
private void DeviceRemoved(CpDeviceList aList, CpDevice aDevice) { lock (this) { string udn = aDevice.Udn(); int count = iDeviceList.Count; for (int i = 0; i < count; i++) { if (iDeviceList[i].Udn() == udn) { iDeviceList.RemoveAt(i); iDeviceList[i].RemoveRef(); } } } }