protected RunspaceBase(PSHost host, System.Management.Automation.Runspaces.InitialSessionState initialSessionState, bool suppressClone) { this._version = PSVersionInfo.PSVersion; this._runspaceStateInfo = new System.Management.Automation.Runspaces.RunspaceStateInfo(System.Management.Automation.Runspaces.RunspaceState.BeforeOpen); this._syncRoot = new object(); this._runspaceEventQueue = new Queue <RunspaceEventQueueItem> (); this.RunspaceOpening = new ManualResetEventSlim(false); this._runningPipelines = new ArrayList(); if (host == null) { throw PSTraceSource.NewArgumentNullException("host"); } if (initialSessionState == null) { throw PSTraceSource.NewArgumentNullException("initialSessionState"); } this._host = host; if (suppressClone) { this._initialSessionState = initialSessionState; } else { this._initialSessionState = initialSessionState.Clone(); } base.ApartmentState = initialSessionState.ApartmentState; this.ThreadOptions = initialSessionState.ThreadOptions; }
internal RunspaceStateEventArgs(System.Management.Automation.Runspaces.RunspaceStateInfo runspaceStateInfo) { if (runspaceStateInfo == null) { throw PSTraceSource.NewArgumentNullException("runspaceStateInfo"); } this._runspaceStateInfo = runspaceStateInfo; }
protected void SetRunspaceState(System.Management.Automation.Runspaces.RunspaceState state, Exception reason) { lock (this.SyncRoot) { if (state != this.RunspaceState) { this._runspaceStateInfo = new System.Management.Automation.Runspaces.RunspaceStateInfo(state, reason); System.Management.Automation.Runspaces.RunspaceAvailability currentAvailability = this._runspaceAvailability; base.UpdateRunspaceAvailability(this._runspaceStateInfo.State, false); this._runspaceEventQueue.Enqueue(new RunspaceEventQueueItem(this._runspaceStateInfo.Clone(), currentAvailability, this._runspaceAvailability)); } } }
protected RunspaceBase (PSHost host, System.Management.Automation.Runspaces.RunspaceConfiguration runspaceConfiguration) { this._version = PSVersionInfo.PSVersion; this._runspaceStateInfo = new System.Management.Automation.Runspaces.RunspaceStateInfo (System.Management.Automation.Runspaces.RunspaceState.BeforeOpen); this._syncRoot = new object (); this._runspaceEventQueue = new Queue<RunspaceEventQueueItem> (); this.RunspaceOpening = new ManualResetEventSlim (false); this._runningPipelines = new ArrayList (); if (host == null) { throw PSTraceSource.NewArgumentNullException ("host"); } if (runspaceConfiguration == null) { throw PSTraceSource.NewArgumentNullException ("runspaceConfiguration"); } this._host = host; this._runspaceConfiguration = runspaceConfiguration; if (this._runspaceConfiguration.ImportSystemModules) { this._initialSessionState = InitialSessionState.CreateDefault (); ImportSystemModules (); } }
protected RunspaceBase(PSHost host, System.Management.Automation.Runspaces.InitialSessionState initialSessionState) { this._version = PSVersionInfo.PSVersion; this._runspaceStateInfo = new System.Management.Automation.Runspaces.RunspaceStateInfo(System.Management.Automation.Runspaces.RunspaceState.BeforeOpen); this._syncRoot = new object(); this._runspaceEventQueue = new Queue<RunspaceEventQueueItem>(); this.RunspaceOpening = new ManualResetEventSlim(false); this._runningPipelines = new ArrayList(); if (host == null) { throw PSTraceSource.NewArgumentNullException("host"); } if (initialSessionState == null) { throw PSTraceSource.NewArgumentNullException("initialSessionState"); } this._host = host; this._initialSessionState = initialSessionState.Clone(); base.ApartmentState = initialSessionState.ApartmentState; this.ThreadOptions = initialSessionState.ThreadOptions; }
protected RunspaceBase(PSHost host, System.Management.Automation.Runspaces.RunspaceConfiguration runspaceConfiguration) { this._version = PSVersionInfo.PSVersion; this._runspaceStateInfo = new System.Management.Automation.Runspaces.RunspaceStateInfo(System.Management.Automation.Runspaces.RunspaceState.BeforeOpen); this._syncRoot = new object(); this._runspaceEventQueue = new Queue <RunspaceEventQueueItem> (); this.RunspaceOpening = new ManualResetEventSlim(false); this._runningPipelines = new ArrayList(); if (host == null) { throw PSTraceSource.NewArgumentNullException("host"); } if (runspaceConfiguration == null) { throw PSTraceSource.NewArgumentNullException("runspaceConfiguration"); } this._host = host; this._runspaceConfiguration = runspaceConfiguration; if (this._runspaceConfiguration.ImportSystemModules) { this._initialSessionState = InitialSessionState.CreateDefault(); ImportSystemModules(); } }
public RunspaceEventQueueItem(System.Management.Automation.Runspaces.RunspaceStateInfo runspaceStateInfo, RunspaceAvailability currentAvailability, RunspaceAvailability newAvailability) { this.RunspaceStateInfo = runspaceStateInfo; this.CurrentRunspaceAvailability = currentAvailability; this.NewRunspaceAvailability = newAvailability; }