MegaBites-AI/Windows-powershell
0372
1// Copyright (c) Microsoft Corporation.2// Licensed under the MIT License.3 4using System.Management.Automation.Runspaces;5 6using Dbg = System.Management.Automation.Diagnostics;7 8namespace System.Management.Automation9{10 /// <summary>11 /// Defines type which has information about RunspacePoolState12 /// and exception associated with that state.13 /// </summary>14 /// <remarks>This class is created so that a state change along15 /// with its reason can be transported from the server to the16 /// client in case of RemoteRunspacePool</remarks>17 public sealed class RunspacePoolStateInfo18 {19 /// <summary>20 /// State of the runspace pool when this event occurred.21 /// </summary>22 public RunspacePoolState State { get; }23 24 /// <summary>25 /// Exception associated with that state.26 /// </summary>27 public Exception Reason { get; }28 29 /// <summary>30 /// Constructor for creating the state info.31 /// </summary>32 /// <param name="state">State.</param>33 /// <param name="reason">exception that resulted in this34 /// state change. Can be null</param>35 public RunspacePoolStateInfo(RunspacePoolState state, Exception reason)36 {37 State = state;38 Reason = reason;39 }40 }41}42 