private static RunspaceState RunspacePoolStateToRunspaceState(RunspacePoolState state) { switch (state) { case RunspacePoolState.BeforeOpen: return RunspaceState.BeforeOpen; case RunspacePoolState.Opening: return RunspaceState.Opening; case RunspacePoolState.Opened: return RunspaceState.Opened; case RunspacePoolState.Closed: return RunspaceState.Closed; case RunspacePoolState.Closing: return RunspaceState.Closing; case RunspacePoolState.Broken: return RunspaceState.Broken; case RunspacePoolState.Disconnecting: return RunspaceState.Disconnecting; case RunspacePoolState.Disconnected: return RunspaceState.Disconnected; case RunspacePoolState.Connecting: return RunspaceState.Connecting; } return RunspaceState.BeforeOpen; }
/// <summary> /// Initializes a new instance of the InvalidRunspacePoolStateException /// with a specified error message and current and expected state. /// </summary> /// <param name="message">The message that describes the error. </param> /// <param name="currentState">Current state of runspace pool.</param> /// <param name="expectedState">Expected state of the runspace pool.</param> internal InvalidRunspacePoolStateException ( string message, RunspacePoolState currentState, RunspacePoolState expectedState ) : base(message) { _expectedState = expectedState; _currentState = currentState; }
internal RunspacePoolStateChangedEventArgs(RunspacePoolState state) { this.stateInfo = new System.Management.Automation.RunspacePoolStateInfo(state, null); }
public RunspacePoolStateInfo(RunspacePoolState state, Exception reason) { this.state = state; this.reason = reason; }
/// <summary> /// Constructor for creating the state info. /// </summary> /// <param name="state">State.</param> /// <param name="reason">exception that resulted in this /// state change. Can be null</param> public RunspacePoolStateInfo(RunspacePoolState state, Exception reason) { State = state; Reason = reason; }
/// <summary> /// Constructor. /// </summary> /// <param name="state"> /// state to raise the event with. /// </param> internal RunspacePoolStateChangedEventArgs(RunspacePoolState state) { RunspacePoolStateInfo = new RunspacePoolStateInfo(state, null); }
public RunspacePoolStateInfo(RunspacePoolState state, Exception reason) { this.state = state; this.reason = reason; }
internal RunspacePoolStateChangedEventArgs(RunspacePoolState state) { using (RunspacePoolStateChangedEventArgs.tracer.TraceConstructor((object)this)) this.stateInfo = new RunspacePoolStateInfo(state, (Exception)null); }
/// <summary> /// Converts a RunspacePoolState to a RunspaceState /// </summary> private static RunspaceState RunspacePoolStateToRunspaceState(RunspacePoolState state) { switch (state) { case RunspacePoolState.BeforeOpen: return RunspaceState.BeforeOpen; case RunspacePoolState.Opening: return RunspaceState.Opening; case RunspacePoolState.Opened: return RunspaceState.Opened; case RunspacePoolState.Closed: return RunspaceState.Closed; case RunspacePoolState.Closing: return RunspaceState.Closing; case RunspacePoolState.Broken: return RunspaceState.Broken; case RunspacePoolState.Disconnecting: return RunspaceState.Disconnecting; case RunspacePoolState.Disconnected: return RunspaceState.Disconnected; case RunspacePoolState.Connecting: return RunspaceState.Connecting; default: Diagnostics.Assert(false, "Unexpected RunspacePoolState"); return 0; } }
/// <summary> /// Constructor /// </summary> /// <param name="state"> /// state to raise the event with. /// </param> internal RunspacePoolStateChangedEventArgs(RunspacePoolState state) { RunspacePoolStateInfo = new RunspacePoolStateInfo(state, null); }
/// <summary> /// Constructor for creating the state info /// </summary> /// <param name="state">state</param> /// <param name="reason">exception that resulted in this /// state change. Can be null</param> public RunspacePoolStateInfo(RunspacePoolState state, Exception reason) { State = state; Reason = reason; }
internal RunspacePoolStateChangedEventArgs(RunspacePoolState state) { this.stateInfo = new System.Management.Automation.RunspacePoolStateInfo(state, null); }
internal RunspacePoolStateChangedEventArgs(RunspacePoolState state) { throw new NotImplementedException(); }
internal InvalidRunspacePoolStateException(string message, RunspacePoolState currentState, RunspacePoolState expectedState) : base(message) { this.expectedState = expectedState; this.currentState = currentState; }
public RunspacePoolStateInfo(RunspacePoolState state, Exception reason) { throw new NotImplementedException(); }