public RunspaceCommandExecutor(Runspace runspace)
        {
            _stopThreadEvent = new ManualResetEvent(false);

            _executor = new Executor(runspace);

            runspace.StateChanged += OnRunspaceStateChanged;
            _runspace = runspace;
        }
 public DriveListAutoCompleteProvider(Executor executor)
     : base(Command, executor)
 {
 }
 public ProviderPathAutoCompleteProvider(Executor executor)
     : base(Command, executor)
 {
 }
        private void InitializeRunspaceAndHost()
        {
            if (null == _shellConfiguration.RunspaceConfiguration)
            {
                _shellConfiguration.RunspaceConfiguration = RunspaceConfiguration.Create();
            }

            _shellConfiguration.Cmdlets.ToList().ForEach(
                cce => _shellConfiguration.RunspaceConfiguration.Cmdlets.Append(cce)
                );

            _rawUi = new HostRawUI(_consoleWindow, _shellConfiguration.ShellName);
            _hostUi = new HostUI(_consoleWindow, _shellConfiguration.UISettings, _rawUi);
            _host = new Host.Host(_shellConfiguration.ShellName, _shellConfiguration.ShellVersion, _hostUi,
                                           _shellConfiguration.RunspaceConfiguration);

            _hostUi.Progress += NotifyProgress;

            _runspace = _host.Runspace;
            _runspace.Open();

            _commandExecutor = new Executor(_runspace);
            _commandExecutor.PipelineException += OnPipelineException;

            _shellConfiguration.InitialVariables.ToList().ForEach(pair =>
                                                                  _runspace.SessionStateProxy.PSVariable.Set(pair)
                );
        }
 public PowerShellTabExpansionAutoCompleteProvider(Executor executor)
 {
     _executor = executor;
 }
 public HistoryStackWalker(Executor executor)
 {
     _executor = executor;
     _index = 0;
 }
 protected CommandAutoCompleteProvider(string commandTemplate, Executor executor)
 {
     _commandTemplate = commandTemplate;
     _executor = executor;
 }