Beispiel #1
0
        public PlayCommand(PlayArgs args) : base(args.EnableAnsiEscape)
        {
            _session = new RecordSession(args.Filename);

            _cancellationTokenSource   = new CancellationTokenSource();
            _readlineCancellationToken = _cancellationTokenSource.Token;
            _readEvent         = new AutoResetEvent(false);
            _dataReceivedEvent = new AutoResetEvent(false);
            Task.Factory.StartNew(ReadKey, TaskCreationOptions.LongRunning);
        }
Beispiel #2
0
        public PlayCommand(PlayArgs args) : base(args.EnableAnsiEscape)
        {
            if (!File.Exists(args.Filename))
            {
                Console.Out.WriteLine($"File {args.Filename} not found.");
                Environment.Exit(1);
            }
            _session = new RecordSession(args.Filename);

            _cancellationTokenSource   = new CancellationTokenSource();
            _readlineCancellationToken = _cancellationTokenSource.Token;
            _readEvent         = new AutoResetEvent(false);
            _dataReceivedEvent = new AutoResetEvent(false);
            Task.Factory.StartNew(ReadKey, TaskCreationOptions.LongRunning);
        }