📄 orgnode.cs
字号:
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.Design;
using System.ComponentModel;
using System.Drawing;
using System.Text;
namespace wssmax
{
/// <summary>
/// OrgNode 的摘要说明。
/// </summary>
public class OrgNode
{
private string ImageUrlAddress;
private object ObjectDemo;
internal OrgNodeCollection OrgNodeCollectionDemo;
private string TypeStyle;
private string ImageAddress;
private string NavigateUrlAddress;
private string TipText;
private string Descript;
public OrgNode()
{
this.OrgNodeCollectionDemo = new OrgNodeCollection(this);
}
public string GetNodeIndex()
{
return "";
}
protected OrgNode GetPreviousSibling()
{
return null;
}
protected virtual bool OnSelectedIndexChange(EventArgs e)
{
return true;
}
public virtual string OrgNodeHtml()
{
return this.OrgNodeHtml(this);
}
public virtual string OrgNodeHtml(OrgNode node)
{
return this.OrgNodeHtml("", node);
}
public virtual string OrgNodeHtml(string templateHtml, OrgNode xNode)
{
string text2;
if ((templateHtml == null) || (templateHtml == ""))
{
text2 = "<TABLE Width=100 align=center border=0><TR><TD align=center style=\"font-size: 12px;font-family: Verdana, Arial;padding : 5px 5px 5px 5px;border:thin solid orange;background-color: lightgrey\" title='{1}'>{3}<a href='{4}'>{0}</a></TD></TR></TABLE>";
}
else
{
text2 = templateHtml;
}
StringBuilder builder1 = new StringBuilder();
string[] textArray1 = new string[5] { (xNode.Text == null) ? "" : xNode.Text, (xNode.Description == null) ? "" : xNode.Description, (xNode.Type == null) ? "" : xNode.Type, (xNode.ImageUrl == "") ? "" : ("<img border=0 src='" + xNode.ImageUrl + "'>"), (xNode.NavigateUrl == null) ? "" : xNode.NavigateUrl } ;
string text1 = xNode.ImageUrl;
if ((text1 == null) || (text1 == ""))
{
string text3;
if ((text3 = xNode.Type.ToUpper()) == null)
{
goto Label_0173;
}
text3 = string.IsInterned(text3);
if (text3 != "ROOT")
{
if (text3 == "GROUP")
{
text1 = this.ImageFolder + "X1Group.gif";
goto Label_0179;
}
if (text3 == "ROLES")
{
text1 = this.ImageFolder + "X1Roles.gif";
goto Label_0179;
}
if (text3 == "LOGIN")
{
text1 = this.ImageFolder + "X1Login.gif";
goto Label_0179;
}
goto Label_0173;
}
text1 = this.ImageFolder + "x1root.gif";
}
goto Label_0179;
Label_0173:
text1 = "";
Label_0179:
textArray1[3] = (text1 == "") ? "" : ("<img border=0 src='" + text1 + "'>");
builder1.AppendFormat(text2, textArray1);
return builder1.ToString();
}
[Category("Data"), DefaultValue("结点描述"), PersistenceMode(PersistenceMode.Attribute)]
public string Description
{
get
{
object obj1 = this.Descript;
if (obj1 == null)
{
return string.Empty;
}
return (string) obj1;
}
set
{
this.Descript = value;
}
}
[Description("存放图片的目录"), Category("Appearance"), DefaultValue(""), Bindable(true)]
public string ImageFolder
{
get
{
if (this.ImageAddress == null)
{
this.ImageAddress = "images/";
}
this.ImageAddress = this.ImageAddress.Trim();
if (!this.ImageAddress.EndsWith(@"\") && !this.ImageAddress.EndsWith("/"))
{
this.ImageAddress = this.ImageAddress + "/";
}
return this.ImageAddress;
}
set
{
this.ImageAddress = value;
}
}
public string ImageUrl
{
get
{
if (this.ImageUrlAddress != null)
{
return this.ImageUrlAddress;
}
return string.Empty;
}
set
{
this.ImageUrlAddress = value;
}
}
[DefaultValue(""), PersistenceMode(PersistenceMode.Attribute), Category("Behavior")]
public string NavigateUrl
{
get
{
object obj1 = this.NavigateUrlAddress;
if (obj1 != null)
{
return (string) obj1;
}
return string.Empty;
}
set
{
this.NavigateUrlAddress = value;
}
}
[MergableProperty(false), DefaultValue((string) null), Category("Data"), PersistenceMode(PersistenceMode.InnerDefaultProperty), Browsable(false)]
public virtual OrgNodeCollection Nodes
{
get
{
return this.OrgNodeCollectionDemo;
}
}
public object Parent
{
get
{
return this.ObjectDemo;
}
set
{
this.ObjectDemo = value;
}
}
[DefaultValue(""), PersistenceMode(PersistenceMode.Attribute), Category("Appearance")]
public string Text
{
get
{
object obj1 = this.TipText;
if (obj1 != null)
{
return (string) obj1;
}
return string.Empty;
}
set
{
this.TipText = value;
}
}
[PersistenceMode(PersistenceMode.Attribute), Category("Data"), DefaultValue("")]
public string Type
{
get
{
if (this.TypeStyle != null)
{
return this.TypeStyle;
}
return string.Empty;
}
set
{
this.TypeStyle = value;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -