예제 #1
0
        public void Start()
        {
            _p.Start();

            if (IsOutputRedirected)
            {
                var stream = new ProcessOutputWrapper(_p, ProcessOutputWrapper.OutputVariant.Stdout);
                stream.StartReading();
                _stdOutContext = new StdTextReadStream(stream);

                stream = new ProcessOutputWrapper(_p, ProcessOutputWrapper.OutputVariant.Stderr);
                stream.StartReading();

                _stdErrContext = new StdTextReadStream(stream);
            }
        }
예제 #2
0
        public void Dispose()
        {
            if (_stdOutContext != null)
            {
                _stdOutContext.Dispose();
                _stdOutContext = null;
            }

            if (_stdErrContext != null)
            {
                _stdErrContext.Dispose();
                _stdErrContext = null;
            }

            if (_stdInContext != null)
            {
                _stdInContext.Dispose();
                _stdInContext = null;
            }

            _p.Dispose();
        }