示例#1
0
        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)
 {
 }
示例#4
0
        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;
 }
示例#6
0
 public HistoryStackWalker(Executor executor)
 {
     _executor = executor;
     _index = 0;
 }
 protected CommandAutoCompleteProvider(string commandTemplate, Executor executor)
 {
     _commandTemplate = commandTemplate;
     _executor = executor;
 }