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(); } }
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(); } }