Exemplo n.º 1
0
 public void StartReplaying(string replayFile)
 {
     InvalidStateException.Assert(mode == MillipedeMode.Unconfigured,
         "Recorder is already started", mode);
     NumberEvents = 0;
     timer = Stopwatch.StartNew();
     mode = MillipedeMode.Playback;
     dataSink = null;
     sinkFile = File.OpenRead(replayFile);
     LastFileName = replayFile;
     LoadNextEvent();
 }
Exemplo n.º 2
0
 public void StartPassThrough()
 {
     InvalidStateException.Assert(mode == MillipedeMode.Unconfigured,
         "Recorder is already started", mode);
     NumberEvents = 0;
     // timer = Stopwatch.StartNew();
     mode = MillipedeMode.PassThrough;
     dataSink = null;
     sinkFile = null;
     syncingTimer = null;
 }
Exemplo n.º 3
0
 public void StartRecording(string recordingFile)
 {
     InvalidStateException.Assert(mode == MillipedeMode.Unconfigured,
         "Recorder is already started", mode);
     NumberEvents = 0;
     timer = Stopwatch.StartNew();
     mode = MillipedeMode.Record;
     dataSink = new MemoryStream();
     sinkFile = File.Create(recordingFile);
     LastFileName = recordingFile;
     syncingTimer = new Timer(SyncRecording, null, TimeSpan.FromSeconds(10),
         TimeSpan.FromSeconds(10));
 }
Exemplo n.º 4
0
        public void Dispose()
        {
            lock (this)
            {
                if(this == singleton) { singleton = null; }
                if(syncingTimer != null) { syncingTimer.Dispose(); }
                syncingTimer = null;

                if(sinkFile != null)
                {
                    if(sinkFile != null && dataSink != null)
                    {
                        SyncRecording(null);
                    }
                    if(sinkFile != null) { sinkFile.Close(); }
                    if(dataSink != null) { dataSink.Dispose(); }
                    sinkFile = null;
                    dataSink = null;
                }
                assignedDescriptors = null;
            }
            mode = MillipedeMode.PassThrough;
        }