📄 htmltextarea.cs
字号:
using System;
using System.Collections.Specialized;
using System.Globalization;
using System.Web.UI;
namespace System.Web.UI.HtmlControls
{
/// <summary>
/// Summary description for HtmlTextArea.
/// </summary>
//.custom instance void [System]System.ComponentModel.DefaultEventAttribute
//.custom instance void System.Web.UI.ValidationPropertyAttribute
public class HtmlTextArea : HtmlContainerControl,IPostBackDataHandler
{
private static object EventServerChange;
static HtmlTextArea()
{
HtmlTextArea.EventServerChange = new Object();
}
public HtmlTextArea() : base("textarea")
{
}
protected virtual void AddParsedSubObject(object obj)
{
if (obj as LiteralControl != null || obj as DataBoundLiteralControl != null)
{
this.AddParsedSubObject(obj);
return;
}
throw new HttpException(System.Web.HttpRuntime.FormatResourceString("Cannot_Have_Children_Of_Type", "HtmlTextArea", obj.GetType().Name.ToString()));
}
protected virtual void OnPreRender(EventArgs e)
{
if ((this.Events[HtmlTextArea.EventServerChange]== null) && !(this.Disabled))
this.ViewState.SetItemDirty("value", false);
}
protected virtual void OnServerChange(EventArgs e)
{
EventHandler local0;
local0 = (EventHandler) this.Events[HtmlTextArea.EventServerChange];
if (local0 != null)
local0.Invoke(this, e);
}
protected virtual void RenderAttributes(HtmlTextWriter writer)
{
writer.WriteAttribute("name", this.RenderedNameAttribute);
this.Attributes.Remove("name");
this.RenderAttributes(writer);
}
bool System.Web.UI.IPostBackDataHandler.LoadPostData(string postDataKey, NameValueCollection postCollection)
{
string local0;
string local1;
local0 = this.Value;
local1 = postCollection.GetValues(postDataKey)[0];
if (local0 == null || local0 != local1)
{
this.Value = System.Web.HttpUtility.HtmlEncode(local1);
return true;
}
return false;
}
void System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent()
{
this.OnServerChange(System.EventArgs.Empty);
}
public event EventHandler ServerChange
{
add
{
this.Events.AddHandler(HtmlTextArea.EventServerChange, value);
}
remove
{
this.Events.RemoveHandler(HtmlTextArea.EventServerChange, value);
}
}
public int Cols
{
get
{
string local0;
local0 = this.Attributes["cols"];
if (local0 == null)
return -1;
return System.Int32.Parse(local0, CultureInfo.InvariantCulture);
}
set
{
this.Attributes["cols"]= System.Web.UI.HtmlControls.HtmlControl.MapIntegerAttributeToString(value);
}
}
public virtual string Name
{
get
{
return this.UniqueID;
}
set
{
}
}
internal string RenderedNameAttribute
{
get
{
return this.Name;
}
}
public int Rows
{
get
{
string local0;
local0 = this.Attributes["rows"];
if (local0 == null)
return -1;
return System.Int32.Parse(local0, CultureInfo.InvariantCulture);
}
set
{
this.Attributes["rows"]= System.Web.UI.HtmlControls.HtmlControl.MapIntegerAttributeToString(value);
}
}
public string Value
{
get
{
return this.InnerHtml;
}
set
{
this.InnerHtml = value;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -