Exemple #1
0
 public void OnCameraDisconnected(object sender, USBEvent e)
 {
     string[] changedParts  = WebcamManager.GetDeviceInfoFromPath(e.DevicePath);
     string[] selectedParts = WebcamManager.GetDeviceInfoFromPath(selectedCameraPath);
     if (string.Compare(changedParts[1], selectedParts[1], true) == 0 && string.Compare(changedParts[2], selectedParts[2], true) == 0)
     {
         selectedCameraConnected = false;
         ReleasePreviousBuffers();
         WebcamManager.ReleaseInactiveCameras();
         Logger.WriteLine("Selected camera disconnected");
         ErrorLog.AddError(ErrorType.Warning, "Selected camera has been disconnected");
     }
 }