예제 #1
0
        /// <summary>
        /// Allows you to transition the session state based on a given action
        /// </summary>
        /// <param name="value"></param>
        /// <param name="action"></param>
        public override bool SetValue(UserSession value, Nullable <UserSessionAction> action)
        {
            if (value == null)
            {
                return(false);
            }

            switch (value.SessionType)
            {
            case UserSessionType.Active:
                return(UserSessionHelper.TryUserSessionConnect(sessionId, "Console"));

            case UserSessionType.Disconnected:
                return(UserSessionHelper.TryUserSessionDisconnect(sessionId));

            case UserSessionType.Locked:
                //
                return(false);
            }

            return(false);
        }