📄 htmlinputcheckbox.cs
字号:
using System;
using System.Collections.Specialized;
namespace System.Web.UI.HtmlControls
{
/// <summary>
/// Summary description for HtmlInputCheckBox.
/// </summary>
//.custom instance void [System]System.ComponentModel.DefaultEventAttribute
public class HtmlInputCheckBox : HtmlInputControl,IPostBackDataHandler
{
private static object EventServerChange;
static HtmlInputCheckBox()
{
HtmlInputCheckBox.EventServerChange = new Object();
}
public HtmlInputCheckBox() : base("checkbox")
{
}
protected virtual void OnPreRender(EventArgs e)
{
if (this.Page != null && !(this.Disabled))
this.Page.RegisterRequiresPostBack(this);
if (this.Events[HtmlInputCheckBox.EventServerChange]== null && !(this.Disabled))
this.ViewState.SetItemDirty("checked", false);
}
protected virtual void OnServerChange(EventArgs e)
{
EventHandler local0;
local0 = (EventHandler) this.Events[HtmlInputCheckBox.EventServerChange];
if (local0 != null)
local0.Invoke(this, e);
}
bool System.Web.UI.IPostBackDataHandler.LoadPostData(string postDataKey, NameValueCollection postCollection)
{
string local0;
bool local1;
bool local2;
local0 = postCollection[postDataKey];
if (local0 != null)
{
// goto i-1;
}
local1 = false;
local2 = (local1 != this.Checked) ;
this.Checked = local1;
return local2;
}
void System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent()
{
this.OnServerChange(System.EventArgs.Empty);
}
public event EventHandler ServerChange
{
add
{
this.Events.AddHandler(HtmlInputCheckBox.EventServerChange, value);
}
remove
{
this.Events.RemoveHandler(HtmlInputCheckBox.EventServerChange, value);
}
}
public bool Checked
{
get
{
string local0;
local0 = this.Attributes["checked"];
if (local0 == null)
return false;
return local0 == "checked";
}
set
{
if (value)
{
this.Attributes["checked"]= "checked";
return;
}
this.Attributes["checked"]= null;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -