public WindowsSessionChangedArguments(SessionChangeDescription changeDescription) { _reasonCode = (SessionChangeReasonCode) Enum.ToObject(typeof(SessionChangeReasonCode), (int)changeDescription.Reason); _sessionId = changeDescription.SessionId; }
public static Kind ToKind(this SessionChangeReasonCode value) { switch (value) { case SessionChangeReasonCode.ConsoleConnect: case SessionChangeReasonCode.RemoteConnect: case SessionChangeReasonCode.SessionLogon: case SessionChangeReasonCode.SessionUnlock: return(Kind.Connected); case SessionChangeReasonCode.ConsoleDisconnect: case SessionChangeReasonCode.RemoteDisconnect: case SessionChangeReasonCode.SessionLogoff: case SessionChangeReasonCode.SessionLock: return(Kind.Disconnected); default: Log.WarnFormat("unknown session state {0}", value); return(Kind.Unknown); } }
public ConsoleSessionChangedArguments(SessionSwitchReason reason) { _reasonCode = (SessionChangeReasonCode)Enum.ToObject(typeof(SessionChangeReasonCode), (int)reason); _sessionId = Process.GetCurrentProcess().SessionId; }