Ejemplo n.º 1
0
        private void Session_StateChanged(object sender, SessionStateChangedEventArgs e)
        {
            var session = (Session)sender;

            if (e.NewState == SessionState.Terminated)
            {
                lock (_sessions) {
                    var userSessions = GetOrCreateSessionList();
                    userSessions.Remove(session);
                }
            }
        }
Ejemplo n.º 2
0
        private void Session_StateChanged(object sender, SessionStateChangedEventArgs e) {
            var session = (Session)sender;
            if (e.NewState == SessionState.Terminated) {
                lock (_sessions) {
                    var userSessions = GetOrCreateSessionList(session.User);
                    userSessions.Remove(session);

                    if (userSessions.Count == 0) {
                        _sessions.Remove(session.User.Name);
                    }
                }
            }
        }