Esempio n. 1
0
 private void StillImageDevice_DeviceEvent(object sender, PortableDeviceEventArgs e)
 {
     if (e.EventType.EventGuid == PortableDeviceGuids.WPD_EVENT_OBJECT_ADDED)
     {
         var id = e.EventType.DeviceObject.ID;
         PhotoCapturedEventArgs args = new PhotoCapturedEventArgs
         {
             WiaImageItem = null,
             CameraDevice = this,
             FileName = e.EventType.DeviceObject.Name,
             Handle = e.EventType.DeviceObject.ID
         };
         OnPhotoCapture(this, args);
     }
 }
Esempio n. 2
0
 private void StillImageDevice_DeviceEvent(object sender, PortableDeviceEventArgs e)
 {
     if (e.EventType.EventGuid == PortableDeviceGuids.WPD_EVENT_DEVICE_REMOVED)
     {
         _timer.Stop();
         StillImageDevice.Disconnect();
         StillImageDevice.IsConnected = false;
         IsConnected = false;
         OnCameraDisconnected(this, new DisconnectCameraEventArgs {StillImageDevice = StillImageDevice});
     }
     else
     {
         //Thread thread = new Thread(getEvent);
         //thread.Start();
     }
 }
        void _stillImageDevice_DeviceEvent(object sender, PortableDeviceEventArgs e)
        {
            if (e.EventType.EventGuid == PortableDeviceGuids.WPD_EVENT_DEVICE_REMOVED)
            {
                StillImageDevice.Disconnect();
                StillImageDevice.IsConnected = false;
                IsConnected = false;

                OnCameraDisconnected(this, new DisconnectCameraEventArgs { StillImageDevice = StillImageDevice });
            }
            else
            {
                getEvent();
            }
        }