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

📄 datagridpagerstyle.cs

📁 不错的人事管理系统
💻 CS
字号:
using System;

namespace System.Web.UI.WebControls
{
	/// <summary>
	/// Summary description for DataGridPagerStyle.
	/// </summary>
	public class DataGridPagerStyle :TableItemStyle
	{
        private const int PROP_MODE = 524288;
		private const int PROP_NEXTPAGETEXT = 1048576;
		private const int PROP_PAGEBUTTONCOUNT = 4194304;
		private const int PROP_POSITION = 8388608;
		private const int PROP_PREVPAGETEXT = 2097152;
		private const int PROP_VISIBLE =16777216;
		private System.Web.UI.WebControls.DataGrid owner;

			
		internal DataGridPagerStyle(DataGrid owner) : base() 
		{
			this.owner = owner;
		}

		
		public virtual void CopyFrom(Style s) 
		{
			DataGridPagerStyle local0;

			if (s != null && !(s.IsEmpty)) 
			{
				this.CopyFrom(s);
				if (s as DataGridPagerStyle != null) 
				{
					local0 = (DataGridPagerStyle) s;
					if (local0.IsSet(524288))
						this.Mode = local0.Mode;
					if (local0.IsSet(1048576))
						this.NextPageText = local0.NextPageText;
					if (local0.IsSet(2097152))
						this.PrevPageText = local0.PrevPageText;
					if (local0.IsSet(4194304))
						this.PageButtonCount = local0.PageButtonCount;
					if (local0.IsSet(8388608))
						this.Position = local0.Position;
					if (local0.IsSet(16777216))
						this.Visible = local0.Visible;
				}
			}
		}

		
		public virtual void MergeWith(Style s) 
		{
			DataGridPagerStyle local0;

			if (s != null && !(s.IsEmpty)) 
			{
				if (this.IsEmpty) 
				{
					this.CopyFrom(s);
					return;
				}
				this.MergeWith(s);
				if (s as DataGridPagerStyle != null) 
				{
					local0 = (DataGridPagerStyle) s;
					if (local0.IsSet(524288) && !(this.IsSet(524288)))
						this.Mode = local0.Mode;
					if (local0.IsSet(1048576) && !(this.IsSet(1048576)))
						this.NextPageText = local0.NextPageText;
					if (local0.IsSet(2097152) && !(this.IsSet(2097152)))
						this.PrevPageText = local0.PrevPageText;
					if (local0.IsSet(4194304) && !(this.IsSet(4194304)))
						this.PageButtonCount = local0.PageButtonCount;
					if (local0.IsSet(8388608) && !(this.IsSet(8388608)))
						this.Position = local0.Position;
					if (local0.IsSet(16777216) && !(this.IsSet(16777216)))
						this.Visible = local0.Visible;
				}
			}
		}

		
		public virtual void Reset() 
		{
//			if (this.IsSet(524288))
//				this.ViewState.Remove("Mode");
//			if (this.IsSet(1048576))
//				this.ViewState.Remove("NextPageText");
//			if (this.IsSet(2097152))
//				this.ViewState.Remove("PrevPageText");
//			if (this.IsSet(4194304))
//				this.ViewState.Remove("PageButtonCount");
//			if (this.IsSet(8388608))
//				this.ViewState.Remove("Position");
//			if (this.IsSet(16777216))
//				this.ViewState.Remove("PagerVisible");
//			this.Reset();
		}

		
		internal bool IsPagerOnBottom
		{
			get
			{
				PagerPosition local0;

				local0 = this.Position;
				if (local0 != 0)
					return local0 == PagerPosition.TopAndBottom;
				return true;
			}
		}

		
		internal bool IsPagerOnTop
		{
			get
			{
				PagerPosition local0;

				local0 = this.Position;
				if (local0 != PagerPosition.Top)
					return local0 == PagerPosition.TopAndBottom;
				return true;
			}
		}

		
		public PagerMode Mode
		{
			get
			{
				if (this.IsSet(524288))
					return (PagerMode) this.ViewState["Mode"];
				return PagerMode.NextPrev;
			}
			set
			{
//				if((int)value < 0 || (int)value > 1)
//					throw new ArgumentOutOfRangeException("value");
//				this.ViewState["Mode"]= value;
//				this.SetBit(524288);
//				this.owner.OnPagerChanged();
			}

		}

		
		public string NextPageText
		{
			get
			{
				if (this.IsSet(1048576))
					return (String) this.ViewState["NextPageText"];
				return "&gt;";
			}
			set
			{

				this.ViewState["NextPageText"]= value;
				this.SetBit(1048576);
				this.owner.OnPagerChanged();
			}
		}

		public int PageButtonCount
		{
			get
			{
				if (this.IsSet(4194304))
					return (int)this.ViewState["PageButtonCount"];
				return 10;
			}
			set
			{

				if (value < 1)
					throw new ArgumentOutOfRangeException("value");
				this.ViewState["PageButtonCount"]= value;
				this.SetBit(4194304);
				this.owner.OnPagerChanged();
			}
		}


		public PagerPosition Position
		{
			get
			{
				if (this.IsSet(8388608))
					return (PagerPosition) this.ViewState["Position"];
				return PagerPosition.Bottom;
			}
			set
			{
				if ((int)value < 0 || (int)value > 2)
					throw new ArgumentOutOfRangeException("value");
				this.ViewState["Position"]= value;
				this.SetBit(8388608);
				this.owner.OnPagerChanged();
			}
		}

		
		public string PrevPageText 
		{
			get
			{
				if (this.IsSet(2097152))
					return (String) this.ViewState["PrevPageText"];
				return "&lt;";
			}
			set
			{
				this.ViewState["PrevPageText"]= value;
				this.SetBit(2097152);
				this.owner.OnPagerChanged();
			}
		}

		
		public bool Visible
		{
			get
			{
				if (this.IsSet(16777216))
					return (Boolean) this.ViewState["PagerVisible"];
				return true;
			}
			set
			{
				this.ViewState["PagerVisible"]= value;
				this.SetBit(16777216);
				this.owner.OnPagerChanged();
			}
		}

	}
}

⌨️ 快捷键说明

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