Esempio n. 1
0
 internal LocalPipeline(System.Management.Automation.Runspaces.LocalRunspace runspace, CommandCollection command, bool addToHistory, bool isNested, ObjectStreamBase inputStream, ObjectStreamBase outputStream, ObjectStreamBase errorStream, PSInformationalBuffers infoBuffers) : base(runspace, command, addToHistory, isNested, inputStream, outputStream, errorStream, infoBuffers)
 {
     this._historyIdForThisPipeline = -1L;
     this._invokeHistoryIds = new List<long>();
     this._stopper = new PipelineStopper(this);
     this.InitStreams();
 }
 internal static ExecutionContextForStepping PrepareExecutionContext(ExecutionContext ctxt, PSInformationalBuffers newBuffers, PSHost newHost)
 {
     ExecutionContextForStepping stepping = new ExecutionContextForStepping(ctxt) {
         originalInformationalBuffers = ctxt.InternalHost.InternalUI.GetInformationalMessageBuffers(),
         originalHost = ctxt.InternalHost.ExternalHost
     };
     ctxt.InternalHost.InternalUI.SetInformationalMessageBuffers(newBuffers);
     ctxt.InternalHost.SetHostRef(newHost);
     return stepping;
 }
        internal static ExecutionContextForStepping PrepareExecutionContext(
            ExecutionContext ctxt,
            PSInformationalBuffers newBuffers,
            PSHost newHost)
        {
            ExecutionContextForStepping result = new ExecutionContextForStepping(ctxt);

            result._originalInformationalBuffers
                = ctxt.InternalHost.InternalUI.GetInformationalMessageBuffers();
            result._originalHost = ctxt.InternalHost.ExternalHost;

            ctxt.InternalHost.InternalUI.SetInformationalMessageBuffers(newBuffers);
            ctxt.InternalHost.SetHostRef(newHost);

            return(result);
        }
Esempio n. 4
0
 protected PipelineBase(System.Management.Automation.Runspaces.Runspace runspace, CommandCollection command, bool addToHistory, bool isNested, ObjectStreamBase inputStream, ObjectStreamBase outputStream, ObjectStreamBase errorStream, PSInformationalBuffers infoBuffers) : base(runspace, command)
 {
     this._pipelineStateInfo = new System.Management.Automation.Runspaces.PipelineStateInfo(System.Management.Automation.Runspaces.PipelineState.NotStarted);
     this._performNestedCheck = true;
     this._executionEventQueue = new Queue<ExecutionEventQueueItem>();
     this._syncRoot = new object();
     this.Initialize(runspace, null, false, isNested);
     if (addToHistory)
     {
         string commandStringForHistory = command.GetCommandStringForHistory();
         this._historyString = commandStringForHistory;
         this._addToHistory = addToHistory;
     }
     this._inputStream = inputStream;
     this._outputStream = outputStream;
     this._errorStream = errorStream;
     this._informationalBuffers = infoBuffers;
 }
Esempio n. 5
0
 internal void SetInformationalMessageBuffers(PSInformationalBuffers informationalBuffers)
 {
     this.informationalBuffers = informationalBuffers;
 }
Esempio n. 6
0
 internal void Initialize(ObjectStreamBase inputstream, ObjectStreamBase outputstream, ObjectStreamBase errorstream, PSInformationalBuffers informationalBuffers, PSInvocationSettings settings)
 {
     this.initialized = true;
     this.informationalBuffers = informationalBuffers;
     this.InputStream = inputstream;
     this.errorstream = errorstream;
     this.outputstream = outputstream;
     this.settings = settings;
     if ((settings == null) || (settings.Host == null))
     {
         this.hostToUse = this.runspacePool.Host;
     }
     else
     {
         this.hostToUse = settings.Host;
     }
     this.dataStructureHandler = this.runspacePool.DataStructureHandler.CreatePowerShellDataStructureHandler(this);
     this.dataStructureHandler.InvocationStateInfoReceived += new EventHandler<RemoteDataEventArgs<PSInvocationStateInfo>>(this.HandleInvocationStateInfoReceived);
     this.dataStructureHandler.OutputReceived += new EventHandler<RemoteDataEventArgs<object>>(this.HandleOutputReceived);
     this.dataStructureHandler.ErrorReceived += new EventHandler<RemoteDataEventArgs<ErrorRecord>>(this.HandleErrorReceived);
     this.dataStructureHandler.InformationalMessageReceived += new EventHandler<RemoteDataEventArgs<InformationalMessage>>(this.HandleInformationalMessageReceived);
     this.dataStructureHandler.HostCallReceived += new EventHandler<RemoteDataEventArgs<RemoteHostCall>>(this.HandleHostCallReceived);
     this.dataStructureHandler.ClosedNotificationFromRunspacePool += new EventHandler<RemoteDataEventArgs<Exception>>(this.HandleCloseNotificationFromRunspacePool);
     this.dataStructureHandler.BrokenNotificationFromRunspacePool += new EventHandler<RemoteDataEventArgs<Exception>>(this.HandleBrokenNotificationFromRunspacePool);
     this.dataStructureHandler.ConnectCompleted += new EventHandler<RemoteDataEventArgs<Exception>>(this.HandleConnectCompleted);
     this.dataStructureHandler.ReconnectCompleted += new EventHandler<RemoteDataEventArgs<Exception>>(this.HandleConnectCompleted);
     this.dataStructureHandler.RobustConnectionNotification += new EventHandler<ConnectionStatusEventArgs>(this.HandleRobustConnectionNotification);
     this.dataStructureHandler.CloseCompleted += new EventHandler<EventArgs>(this.HandleCloseCompleted);
 }