Ejemplo n.º 1
0
 private void DeviceAdded(CpDeviceList aList, CpDevice aDevice)
 {
     lock (this)
     {
         PrintDeviceInfo("Added", aDevice);
         aDevice.AddRef();
         iDeviceList.Add(aDevice);
     }
 }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
 private void DeviceAdded(CpDeviceList aList, CpDevice aDevice)
 {
     lock (this)
     {
         if (aDevice.Udn() == DeviceBasic.gDeviceName)
         {
             aDevice.AddRef();
             iDeviceList.Add(aDevice);
         }
     }
 }
Ejemplo n.º 4
0
 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();
             }
         }
     }
 }