Esempio n. 1
0
        /*void camera_CameraErrorOccurred(object sender, CameraErrorEventArgs e)
        {
            InvokeGuiThread(() => Log.Write("Camera error: " + (e.Details ?? e.Error.ToString())));
        }*/
        /// <summary>
        /// Handler for the VideoCapturingStateChanged event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void OnVideoCapturingStateChanged(object sender, VideoCapturingEventArgs e)
        {
            var cci = sender as CameraConfigurationItem;
            var startRecordingBtn = this.Controls.Find("startRecordingBTN" + cci.id, true)[0] as Button;
            var stopRecordingBtn = this.Controls.Find("stopRecordingBTN" + cci.id, true)[0] as Button;
            var recordingStatusLB = this.Controls.Find("recordingStatusLB" + cci.id, true)[0] as Label;

              InvokeGuiThread(() =>
              {
            switch (e.CapturingState)
            {
              case VideoCapturingState.Recording:
            startRecordingBtn.Enabled = false;
                        stopRecordingBtn.Enabled = true;
            break;
              case VideoCapturingState.Stopped:
                        startRecordingBtn.Enabled = true;
                        stopRecordingBtn.Enabled = false;
            break;
            }
              });
              ChangeRecordingStatus(recordingStatusLB, e.CapturingState.ToString());
              Log.Write("Camera" + cci.id + ": Capturing status changed: " + e.CapturingState.ToString());
        }
        protected void OnVideoCapturingStateChanged(object sender, VideoCapturingEventArgs e)
        {
            //Set the video capturing state for later use within this class
              videoCapturingState = e.CapturingState;

              //Raise the event if there are subscribers
              if (VideoCapturingStateChanged != null)
            VideoCapturingStateChanged(sender, e);
        }