public MonitorLocalProcess(LocalProcessBuilder localProcessBuilder, Func <string, MonitorState?> monitor, ILogger logger)
        {
            localProcessBuilder.VerifyNotNull(nameof(localProcessBuilder));
            monitor.VerifyNotNull(nameof(monitor));
            logger.VerifyNotNull(nameof(logger));

            _localProcessBuilder = new LocalProcessBuilder(localProcessBuilder);
            _monitor             = monitor;
            _logger        = logger;
            _monitorStream = new MonitorStream(Monitor);
        }
Exemple #2
0
        public LocalProcessBuilder(LocalProcessBuilder clone)
        {
            clone.VerifyNotNull(nameof(clone));

            SuccessExitCode  = clone.SuccessExitCode;
            ExecuteFile      = clone.ExecuteFile;
            Arguments        = clone.Arguments;
            WorkingDirectory = clone.WorkingDirectory;
            CaptureOutput    = clone.CaptureOutput;
            OnExit           = clone.OnExit;
        }
Exemple #3
0
        public LocalProcess(LocalProcessBuilder builder, ILogger logger)
        {
            builder.VerifyNotNull(nameof(builder));
            logger.VerifyNotNull(nameof(logger));

            _logger           = logger;
            _successExitCode  = builder.SuccessExitCode;
            _executeFile      = builder.ExecuteFile;
            _arguments        = builder.Arguments;
            _workingDirectory = builder.WorkingDirectory;
            _captureOutput    = builder.CaptureOutput;
            _useShellExecute  = builder.UseShellExecute;

            _onExitNotify = builder.OnExit != null ? new SubjectScope <Action>(builder.OnExit) : null;
        }
Exemple #4
0
 public static MonitorLocalProcess Build(this LocalProcessBuilder builder, Func <string, MonitorState?> monitor, ILogger logger) => new MonitorLocalProcess(builder, monitor, logger);