private void CloseLiveSession()
 {
     _stopLive = true;
     if (_bitmapLiveSource != null)
     {
         _bitmapLiveSource.LiveContentEvent -= BitmapLiveSourceLiveContentEvent;
         _bitmapLiveSource.LiveModeStart     = false;
         _bitmapLiveSource.Close();
         _bitmapLiveSource = null;
     }
     if (pictureBox.Height != 0 && pictureBox.Width != 0)
     {
         pictureBox.Image = new Bitmap(_blackImage, pictureBox.Size);
     }
 }
 private void TerminateVideo()
 {
     if (_bitmapLiveSource != null)
     {
         _bitmapLiveSource.LiveContentEvent -= new EventHandler(BitmapLiveSourceLiveContentEvent);
         _bitmapLiveSource.LiveModeStart     = false;
         _bitmapLiveSource.Close();
         _bitmapLiveSource = null;
     }
     if (_imageViewerControl != null)
     {
         _imageViewerControl.Disconnect();
         _imageViewerControl.Close();
         _imageViewerControl = null;
     }
 }