Exemple #1
0
 public InputService(
     IKernel32Api kernel32Api,
     PipeStore pipeStore,
     ProcessService processService)
 {
     _kernel32Api    = kernel32Api ?? throw new ArgumentNullException(nameof(kernel32Api));
     _inputPipe      = pipeStore?.Invoke(PipeType.Input) ?? throw new ArgumentNullException(nameof(pipeStore));
     _processService = processService ?? throw new ArgumentNullException(nameof(processService));
 }
Exemple #2
0
 public ProcessService(
     IKernel32Api kernel32Api,
     InputArguments inputArguments,
     ILogger logger)
 {
     _kernel32Api             = kernel32Api ?? throw new ArgumentNullException(nameof(kernel32Api));
     _inputArguments          = inputArguments ?? throw new ArgumentNullException(nameof(inputArguments));
     _logger                  = logger ?? throw new ArgumentNullException(nameof(logger));
     _cancellationTokenSource = new CancellationTokenSource();
 }
Exemple #3
0
        public OutputService(
            IKernel32Api kernel32Api,
            PipeStore pipeStore,
            ProcessService processService,
            InputService inputService)
        {
            _kernel32Api    = kernel32Api ?? throw new ArgumentNullException(nameof(kernel32Api));
            _outputPipe     = pipeStore(PipeType.Output) ?? throw new ArgumentNullException(nameof(pipeStore));
            _processService = processService ?? throw new ArgumentNullException(nameof(processService));
            _inputService   = inputService ?? throw new ArgumentNullException(nameof(inputService));

            inputService.Resize += InputService_Resize;
        }
Exemple #4
0
        public OutputService(
            ITerminalContainer terminalContainer,
            IKernel32Api kernel32Api,
            ILogger logger)
        {
            _terminalContainer = terminalContainer ?? throw new ArgumentNullException(nameof(terminalContainer));
            _kernel32Api       = kernel32Api ?? throw new ArgumentNullException(nameof(kernel32Api));
            _logger            = logger ?? throw new ArgumentNullException(nameof(logger));

            _tasks           = new Dictionary <ITerminal, Task>();
            _previousBuffers = new ConcurrentDictionary <ITerminal, CharInfo[]>();

            terminalContainer.ActiveTerminalChanged += TerminalContainer_ActiveTerminalChanged;
        }
Exemple #5
0
        public InputService(
            ITerminalContainer terminalContainer,
            IKernel32Api kernel32Api,
            IWinTerMulConfiguration configuration,
            ITerminalFactory terminalFactory)
        {
            _terminalContainer = terminalContainer ?? throw new ArgumentNullException(nameof(terminalContainer));
            _kernel32Api       = kernel32Api ?? throw new ArgumentNullException(nameof(kernel32Api));
            _configuration     = configuration ?? throw new ArgumentNullException(nameof(configuration));
            _terminalFactory   = terminalFactory ?? throw new ArgumentNullException(nameof(terminalFactory));

            _prefixKeyWithoutCtrl             = _configuration.PrefixKey[2];
            _prefixKey                        = _prefixKeyWithoutCtrl - 'a' + 1;
            _charactersToIgnoreAfterPrefixKey = new[] { _prefixKey, _prefixKeyWithoutCtrl, 0 };

            _kernel32Api.TreatControlCAsInput();
        }