Example #1
0
 public WindowsSessionChangedArguments(SessionChangeDescription changeDescription)
 {
     _reasonCode =
         (SessionChangeReasonCode)
         Enum.ToObject(typeof(SessionChangeReasonCode), (int)changeDescription.Reason);
     _sessionId = changeDescription.SessionId;
 }
Example #2
0
        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);
            }
        }
Example #3
0
 public ConsoleSessionChangedArguments(SessionSwitchReason reason)
 {
     _reasonCode = (SessionChangeReasonCode)Enum.ToObject(typeof(SessionChangeReasonCode), (int)reason);
     _sessionId  = Process.GetCurrentProcess().SessionId;
 }
Example #4
0
 public WindowsSessionChangedArguments(SessionChangeDescription changeDescription)
 {
     _reasonCode =
         (SessionChangeReasonCode)
         Enum.ToObject(typeof(SessionChangeReasonCode), (int)changeDescription.Reason);
     _sessionId = changeDescription.SessionId;
 }
Example #5
0
 public ConsoleSessionChangedArguments(SessionSwitchReason reason)
 {
     _reasonCode = (SessionChangeReasonCode)Enum.ToObject(typeof(SessionChangeReasonCode), (int)reason);
     _sessionId = Process.GetCurrentProcess().SessionId;
 }