migrate to new git
This commit is contained in:
66
web/App_Code/CustomNode.cs
Normal file
66
web/App_Code/CustomNode.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Web;
|
||||
using System.Collections.Specialized;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
public class CustomTreeNode : TreeNode
|
||||
{
|
||||
public CustomTreeNode()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// used to store Node Attributes
|
||||
/// </summary>
|
||||
|
||||
private NameValueCollection _Attributes = new NameValueCollection();
|
||||
/// <summary>
|
||||
///used to store the CSS Class applied to a node.
|
||||
/// </summary>
|
||||
|
||||
private string _cssClass;
|
||||
/// <summary>
|
||||
/// Property used to set the CSS Class applied to a Node
|
||||
/// </summary>
|
||||
public string cssClass
|
||||
{
|
||||
get { return _cssClass; }
|
||||
set { _cssClass = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Property used to add Attributes to a node
|
||||
/// </summary>
|
||||
public NameValueCollection Attributes
|
||||
{
|
||||
get { return this._Attributes; }
|
||||
set { this._Attributes = value; }
|
||||
}
|
||||
/// <summary>
|
||||
/// add additional rendering to the node
|
||||
/// Add a div Tag and a class Attribute
|
||||
/// </summary>
|
||||
/// <param name="writer">represents the output stream used to write content to a Web page</param>
|
||||
protected override void RenderPreText(HtmlTextWriter writer)
|
||||
{
|
||||
writer.AddAttribute(HtmlTextWriterAttribute.Class, cssClass);
|
||||
writer.AddAttribute(HtmlTextWriterAttribute.Onclick, "loadingShow(this)");
|
||||
//執行取得座標的java函式
|
||||
writer.RenderBeginTag(HtmlTextWriterTag.Div);
|
||||
base.RenderPreText(writer);
|
||||
}
|
||||
/// <summary>
|
||||
/// add additional rendering to the node
|
||||
/// End Tag
|
||||
/// </summary>
|
||||
/// <param name="writer">represents the output stream used to write content to a Web page</param>
|
||||
protected override void RenderPostText(HtmlTextWriter writer)
|
||||
{
|
||||
writer.RenderEndTag();
|
||||
base.RenderPostText(writer);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user