示例#1
0
 /// <summary>
 /// Ends the current playback session.
 /// </summary>
 public static void EndPlayBack()
 {
     if (action != RecorderState.PlayBack)
     {
         throw new InvalidOperationException("Recorder is not currently playing.");
     }
     if (OnEndPlayback != null)
     {
         OnEndPlayback(recorder, EventArgs.Empty);
     }
     recorder.EndPlayBack();
     MockService.ResetSession();
     currentRecordingName = null;
     action = RecorderState.None;
 }
示例#2
0
 /// <summary>
 /// Initiates a playback session.
 /// </summary>
 public static void BeginPlayBack(string recordingName)
 {
     if (recorder == null)
     {
         throw new InvalidOperationException("A recorder needs to be registered to the recorder before starting a RecorderManager session.");
     }
     if (action != RecorderState.None)
     {
         throw new InvalidOperationException("Recorder is already busy playing or recording.");
     }
     currentRecordingName = recordingName;
     MockService.ResetSession();
     recorder.BeginPlayBack(recordingName);
     action = RecorderState.PlayBack;
     if (OnBeginPlayback != null)
     {
         OnBeginPlayback(recorder, EventArgs.Empty);
     }
 }