Beispiel #1
0
        private void OnSessionSwitch(object sender, SessionSwitchEventArgs e)
        {
            if (m_evHandler != null)
            {
                SessionLockReason r = SessionLockReason.Unknown;
                if (e.Reason == SessionSwitchReason.SessionLock)
                {
                    r = SessionLockReason.Lock;
                }
                else if (e.Reason == SessionSwitchReason.SessionLogoff)
                {
                    r = SessionLockReason.Ending;
                }
                else if (e.Reason == SessionSwitchReason.ConsoleDisconnect)
                {
                    r = SessionLockReason.UserSwitch;
                }
                else if ((e.Reason == SessionSwitchReason.SessionRemoteControl) ||
                         (e.Reason == SessionSwitchReason.RemoteConnect) ||
                         (e.Reason == SessionSwitchReason.RemoteDisconnect))
                {
                    r = SessionLockReason.RemoteControlChange;
                }

                if (r != SessionLockReason.Unknown)
                {
                    m_evHandler(sender, new SessionLockEventArgs(r));
                }
            }
        }
Beispiel #2
0
 public SessionLockEventArgs(SessionLockReason r)
 {
     m_r = r;
 }
		public SessionLockEventArgs(SessionLockReason r)
		{
			m_r = r;
		}