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

📄 htmlinputbutton.cs

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

namespace System.Web.UI.HtmlControls
{
	/// <summary>
	/// Summary description for HtmlInputButton.
	/// </summary>
	//.custom instance void [System]System.ComponentModel.DefaultEventAttribute
	public class HtmlInputButton : HtmlInputControl,IPostBackEventHandler
	{
		private static object EventServerClick;

		static HtmlInputButton() 
		{
			HtmlInputButton.EventServerClick = new Object();
		}

		public HtmlInputButton(string type) : base(type) 
		{
		}

		public HtmlInputButton() : base("button") 
		{
		}

		protected virtual void OnPreRender(EventArgs e) 
		{
			this.OnPreRender(e);
//			if (this.Page != null && (this.Events[HtmlInputButton.EventServerClick]!= null) && System.String.Compare(this.Type, "submit", true) != 0)
				this.Page.RegisterPostBackScript();
		}

		protected virtual void OnServerClick(EventArgs e) 
		{
			EventHandler local0;

			local0 = (EventHandler) this.Events[HtmlInputButton.EventServerClick];
			if (local0 != null)
				local0.Invoke(this, e);
		}

		protected virtual void RenderAttributes(HtmlTextWriter writer) 
		{
			string local0;
			bool local1;
			bool local2;

			local0 = this.Type;
			local1 = System.String.Compare(local0, "submit", true) == 0;
			if (!(local1))
			{
//				goto i-1;
			}
			local2 = false;
			if (this.Page != null) 
			{
				if (local1) 
				{
					if (this.CausesValidation)
					{
//						goto i-1;
					}
//					System.Web.UI.Util.WriteOnClickAttribute(this, local1, local2, this.Page.Validators.Count > 0, false);
				}
				else 		if (local2 && System.String.Compare(local0, "button", true) == 0) 
				{
					if (this.CausesValidation)
					{
//						goto i-1;
					}
//					System.Web.UI.Util.WriteOnClickAttribute(this, local1, local2, this.Page.Validators.Count > 0, false);
				}
			}
			this.RenderAttributes(writer);
		}

		void System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(string eventArgument) 
		{
			if (this.CausesValidation)
				this.Page.Validate();
			this.OnServerClick(System.EventArgs.Empty);
		}

		public event EventHandler ServerClick 
		{
			add
			{
				this.Events.AddHandler(HtmlInputButton.EventServerClick, value);
			}
			remove
			{
				this.Events.RemoveHandler(HtmlInputButton.EventServerClick, value);
			}
		}

		public bool CausesValidation 
		{
			get
			{
				object local0;

				local0 = this.ViewState["CausesValidation"];
				if (local0 != null)
					return (Boolean) local0;
				return true;
			}
			set
			{
				this.ViewState["CausesValidation"]= value;
			}
		}
	}
}

⌨️ 快捷键说明

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