示例#1
0
        /// <summary>
        /// Clear the currently logged in user state.
        /// </summary>
        /// <returns>true means there no currently logged in user.</returns>
        public static bool Logout()
        {
            UserEventArgs _args = new UserEventArgs();

            if (BeforeLogout != null)
            {
                User.BeforeLogout(null, _args);
            }

            if (!_args.Cancel)
            {
                Service.Instance.InternalUser = new User();
                _args.Success = true;
            }
            else
            {
                _args.Success = false;
            }

            if (AfterLogout != null)
            {
                User.AfterLogout(null, _args);
            }

            return(_args.Success);
        }