Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 4
0
 public static MonitorLocalProcess Build(this LocalProcessBuilder builder, Func <string, MonitorState?> monitor, ILogger logger) => new MonitorLocalProcess(builder, monitor, logger);