internal RemoteSessionStateInfo(RemoteSessionStateInfo sessionStateInfo) { using (RemoteSessionStateInfo._trace.TraceConstructor((object)this)) { this._state = sessionStateInfo.State; this._reason = sessionStateInfo.Reason; } }
internal RemoteSessionStateEventArgs(RemoteSessionStateInfo remoteSessionStateInfo) { using (RemoteSessionStateEventArgs._trace.TraceConstructor((object)this)) { if (remoteSessionStateInfo == null) { RemoteSessionStateEventArgs._trace.NewArgumentNullException(nameof(remoteSessionStateInfo)); } this._remoteSessionStateInfo = remoteSessionStateInfo; } }
private void SetState(RemoteSessionState newState, Exception reason) { RemoteSessionState state = this._state; if (newState != state) { this._state = newState; _trace.WriteLine("state machine state transition: from state {0} to state {1}", new object[] { state, this._state }); RemoteSessionStateInfo remoteSessionStateInfo = new RemoteSessionStateInfo(this._state, reason); RemoteSessionStateEventArgs item = new RemoteSessionStateEventArgs(remoteSessionStateInfo); this._clientRemoteSessionStateChangeQueue.Enqueue(item); } }
/// <summary> /// Sets the state of the state machine. Since only /// one thread can be manipulating the state at a time /// the state is not synchronized. /// </summary> /// <param name="newState">New state of the state machine.</param> /// <param name="reason">reason why the state machine is set /// to the new state</param> private void SetState(RemoteSessionState newState, Exception reason) { RemoteSessionState oldState = _state; if (newState != oldState) { _state = newState; s_trace.WriteLine("state machine state transition: from state {0} to state {1}", oldState, _state); RemoteSessionStateInfo stateInfo = new RemoteSessionStateInfo(_state, reason); RemoteSessionStateEventArgs sessionStateEventArg = new RemoteSessionStateEventArgs(stateInfo); _clientRemoteSessionStateChangeQueue.Enqueue(sessionStateEventArg); } }
/// <summary> /// Sets the state of the state machine. Since only /// one thread can be manipulating the state at a time /// the state is not synchronized /// </summary> /// <param name="newState">new state of the state machine</param> /// <param name="reason">reason why the state machine is set /// to the new state</param> private void SetState(RemoteSessionState newState, Exception reason) { RemoteSessionState oldState = _state; if (newState != oldState) { _state = newState; s_trace.WriteLine("state machine state transition: from state {0} to state {1}", oldState, _state); RemoteSessionStateInfo stateInfo = new RemoteSessionStateInfo(_state, reason); RemoteSessionStateEventArgs sessionStateEventArg = new RemoteSessionStateEventArgs(stateInfo); _clientRemoteSessionStateChangeQueue.Enqueue(sessionStateEventArg); } }