⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sessionfacade.cs

📁 YetAnotherForum.Net+ScrewTurnWiki中文完美汉化增强版
💻 CS
字号:

using System;
using System.Collections.Generic;
using System.Text;
using System.Web.SessionState;
using System.Web;

namespace ScrewTurn.Wiki {

	/// <summary>
	/// Exposes in a strongly-typed fashion the Session variables.
	/// </summary>
	public static class SessionFacade {

		/// <summary>
		/// Gets the current Session object.
		/// </summary>
		private static HttpSessionState Session {
			get { return HttpContext.Current.Session; }
		}

		/// <summary>
		/// Gets or sets the Login Key.
		/// </summary>
		public static string LoginKey {
			get { return (string)Session["LoginKey"]; }
			set { Session["LoginKey"] = value; }
		}

		/// <summary>
		/// Gets or sets the Username.
		/// </summary>
		public static string Username {
			get { return (string)Session["Username"]; }
			set { Session["Username"] = value; }
		}

		/// <summary>
		/// Gets or sets a value indicating whether the User is an Administrator.
		/// </summary>
		public static bool Admin {
			get {
				if(LoginKey != null)
					return (bool)Session["Admin"];
				else return false;
			}
			set { Session["Admin"] = value; }
		}

		/// <summary>
		/// Gets or sets the Admin View.
		/// </summary>
		public static int AdminView {
			get {
				if(Session["AdminView"] != null)
					return (int)Session["AdminView"];
				else return -1;
			}
			set { Session["AdminView"] = value; }
		}

		/// <summary>
		/// Gets or sets the CAPTCHA string.
		/// </summary>
		public static string CaptchaString {
			get { return (string)Session["CaptchaString"]; }
			set { Session["CaptchaString"] = value; }
		}

		/// <summary>
		/// Gets or sets the Breadcrumbs Manager.
		/// </summary>
		public static BreadcrumbsManager Breadcrumbs {
			get { return (BreadcrumbsManager)Session["Breadcrumbs"]; }
			set { Session["Breadcrumbs"] = value; }
		}

	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -