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

📄 fontinfo.cs

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

namespace System.Web.UI.WebControls
{
	/// <summary>
	/// Summary description for FontInfo.
	/// </summary>
	//.custom instance void [System]System.ComponentModel.TypeConverterAttribute
	public class FontInfo
	{
		private System.Web.UI.WebControls.Style owner;

		internal FontInfo(Style owner) : base() 
		{
			this.owner = owner;
		}

		public void CopyFrom(FontInfo f) 
		{
			if (f != null) 
			{
				if (f.Owner.IsSet(512))
					this.Names = f.Names;
				if (f.Owner.IsSet(1024) && System.Web.UI.WebControls.FontUnit.op_Inequality(f.Size, System.Web.UI.WebControls.FontUnit.Empty))
					this.Size = f.Size;
				if (f.Owner.IsSet(2048) && f.Bold)
					this.Bold = true;
				if (f.Owner.IsSet(4096) && f.Italic)
					this.Italic = true;
				if (f.Owner.IsSet(16384) && f.Overline)
					this.Overline = true;
				if (f.Owner.IsSet(32768) && f.Strikeout)
					this.Strikeout = true;
				if (f.Owner.IsSet(8192) && f.Underline)
					this.Underline = true;
			}
		}

		public void MergeWith(FontInfo f) 
		{
			if (f != null) 
			{
				if (f.Owner.IsSet(512) && !(this.owner.IsSet(512)))
					this.Names = f.Names;
				if (f.Owner.IsSet(1024) && !(this.owner.IsSet(1024)) || System.Web.UI.WebControls.FontUnit.op_Equality(this.Size, System.Web.UI.WebControls.FontUnit.Empty))
					this.Size = f.Size;
				if (f.Owner.IsSet(2048) && !(this.owner.IsSet(2048)))
					this.Bold = f.Bold;
				if (f.Owner.IsSet(4096) && !(this.owner.IsSet(4096)))
					this.Italic = f.Italic;
				if (f.Owner.IsSet(16384) && !(this.owner.IsSet(16384)))
					this.Overline = f.Overline;
				if (f.Owner.IsSet(32768) && !(this.owner.IsSet(32768)))
					this.Strikeout = f.Strikeout;
				if (f.Owner.IsSet(8192) && !(this.owner.IsSet(8192)))
					this.Underline = f.Underline;
			}
		}

		internal void Reset() 
		{
			if (this.owner.IsSet(512))
				this.owner.ViewState.Remove("Font_Names");
			if (this.owner.IsSet(1024))
				this.owner.ViewState.Remove("Font_Size");
			if (this.owner.IsSet(2048))
				this.owner.ViewState.Remove("Font_Bold");
			if (this.owner.IsSet(4096))
				this.owner.ViewState.Remove("Font_Italic");
			if (this.owner.IsSet(8192))
				this.owner.ViewState.Remove("Font_Underline");
			if (this.owner.IsSet(16384))
				this.owner.ViewState.Remove("Font_Overline");
			if (this.owner.IsSet(32768))
				this.owner.ViewState.Remove("Font_Strikeout");
		}

		public bool ShouldSerializeNames() 
		{
			string[] local0;

			local0 = this.Names;
			return (int) local0.Length > 0;
		}

		public virtual string ToString() 
		{
			string local0;
			string local1;
			FontUnit local2;

			local2 = this.Size;
			local0 = local2.ToString();
			local1 = this.Name;
			if (local0.Length != 0) 
			{
				if (local1.Length != 0)
					local1 = local1 + ", " + local0;
				else
					local1 = local0;
			}
			return local1;
		}

		public bool Bold 
		{
			get
			{
				if (this.owner.IsSet(2048))
					return (Boolean) this.owner.ViewState["Font_Bold"];
				return false;
			}
			set
			{
				this.owner.ViewState["Font_Bold"]= value;
				this.owner.SetBit(2048);
			}
		}

		public bool Italic 
		{
			get
			{
				if (this.owner.IsSet(4096))
					return (Boolean) this.owner.ViewState["Font_Italic"];
				return false;
			}
			set
			{
				this.owner.ViewState["Font_Italic"]= value;
				this.owner.SetBit(4096);
			}
		}

		public string Name 
		{
			get
			{
				string[] local0;

				local0 = this.Names;
				if ((int) local0.Length > 0)
					return local0[0];
				return System.String.Empty;
			}
			set
			{
				string[] local0;

				if (value == null)
					throw new ArgumentNullException("value");
				if (value.Length == 0) 
				{
					this.Names = null;
					return;
				}
				local0 = new String[1];
				local0[0] = value;
				this.Names = local0;
			}
		}
 
		public string[] Names 
		{
			get
			{
				string[] local0;

				if (this.owner.IsSet(512)) 
				{
					local0 = (string[]) this.owner.ViewState["Font_Names"];
					if (local0 != null)
						return local0;
				}
				return new String[0];
			}
			set
			{
				this.owner.ViewState["Font_Names"]= value;
				this.owner.SetBit(512);
			}
		}

		public bool Overline 
		{
			get
			{
				if (this.owner.IsSet(16384))
					return (Boolean) this.owner.ViewState["Font_Overline"];
				return false;
			}
			set
			{
				this.owner.ViewState["Font_Overline"]= value;
				this.owner.SetBit(16384);
			}
		}

		internal Style Owner 
		{
			get
			{
				return this.owner;
			}
		}

		public FontUnit Size 
		{
			get
			{
				if (this.owner.IsSet(1024))
					return (FontUnit) this.owner.ViewState["Font_Size"];
				return System.Web.UI.WebControls.FontUnit.Empty;
			}
			set
			{
				Unit local0;

				if (value.Type == FontSize.AsUnit) 
				{
					local0 = value.Unit;
					if (local0.Value < 0)
						throw new ArgumentOutOfRangeException("value");
				}
				this.owner.ViewState["Font_Size"]= value;
				this.owner.SetBit(1024);
			}
		}

		public bool Strikeout 
		{
			get
			{
				if (this.owner.IsSet(32768))
					return (Boolean) this.owner.ViewState["Font_Strikeout"];
				return false;
			}
			set
			{
				this.owner.ViewState["Font_Strikeout"]= value;
				this.owner.SetBit(32768);
			}
		}

		public bool Underline 
		{
			get
			{
				if (this.owner.IsSet(8192))
					return (Boolean) this.owner.ViewState["Font_Underline"];
				return false;
			}
			set
			{
				this.owner.ViewState["Font_Underline"]= value;
				this.owner.SetBit(8192);
			}
		}
	}
}

⌨️ 快捷键说明

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