Пример #1
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
         });
     }
 }
Пример #2
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);
     }
 }