コード例 #1
0
 public WindowsSessionChangedArguments(SessionChangeDescription changeDescription)
 {
     _reasonCode =
         (SessionChangeReasonCode)
         Enum.ToObject(typeof(SessionChangeReasonCode), (int)changeDescription.Reason);
     _sessionId = changeDescription.SessionId;
 }
コード例 #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);
            }
        }
コード例 #3
0
 public ConsoleSessionChangedArguments(SessionSwitchReason reason)
 {
     _reasonCode = (SessionChangeReasonCode)Enum.ToObject(typeof(SessionChangeReasonCode), (int)reason);
     _sessionId  = Process.GetCurrentProcess().SessionId;
 }
コード例 #4
0
 public WindowsSessionChangedArguments(SessionChangeDescription changeDescription)
 {
     _reasonCode =
         (SessionChangeReasonCode)
         Enum.ToObject(typeof(SessionChangeReasonCode), (int)changeDescription.Reason);
     _sessionId = changeDescription.SessionId;
 }
コード例 #5
0
ファイル: ConsoleRunHost.cs プロジェクト: Jaensche/Topshelf
 public ConsoleSessionChangedArguments(SessionSwitchReason reason)
 {
     _reasonCode = (SessionChangeReasonCode)Enum.ToObject(typeof(SessionChangeReasonCode), (int)reason);
     _sessionId = Process.GetCurrentProcess().SessionId;
 }