本文整理汇总了C#中System.Web.UI.WebControls.TreeNode.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# TreeNode.GetType方法的具体用法?C# TreeNode.GetType怎么用?C# TreeNode.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.WebControls.TreeNode
的用法示例。
在下文中一共展示了TreeNode.GetType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: buildBreadcrumbs
protected string buildBreadcrumbs(TreeNode startingNode)
{
if (startingNode == null)
return "<span class=\"breadCrumLabel\">Path</span>";
string internalValuePath = (string)startingNode.GetType().InvokeMember("InternalValuePath", System.Reflection.BindingFlags.Default | System.Reflection.BindingFlags.GetProperty | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance, null, startingNode, null);
string postBackUrl = this.Page.ClientScript.GetPostBackClientHyperlink(this.tv, "s" + internalValuePath, true);
string breadcrumSeparatorImageUrl = this.getImageUrl("breadcrumseparator.gif");
string separator = String.Format("<span class=\"breadCrumSeparator\"> <img src=\"{0}\" alt=\">>\" title=\">>\" /> </span>", breadcrumSeparatorImageUrl);
string nodeText = startingNode.Parent != null ? startingNode.Text : "Storage";
string breadCrum;
if (startingNode == this.tv.SelectedNode)
{
string template = "<span class=\"breadCrumLast\" title=\"{1}\"><img src=\"{0}\" alt=\"{1}\" title=\"{1}\" /> {2}</span> ";
breadCrum = String.Format(template, startingNode.ImageUrl, Utility.QuoteJScriptString(startingNode.ToolTip, false), Utility.QuoteJScriptString(nodeText, false));
}
else
{
string template = "<a href=\"{0}\" title=\"{1}\" class=\"breadCrum\"><img src=\"{2}\" alt=\"{3}\" title=\"{3}\" /> {4}</a> ";
breadCrum = String.Format(template, postBackUrl, Utility.QuoteJScriptString(startingNode.ToolTip, false), startingNode.ImageUrl, Utility.QuoteJScriptString(startingNode.ToolTip, false), Utility.QuoteJScriptString(nodeText, false));
}
string result = this.buildBreadcrumbs(startingNode.Parent) + separator + breadCrum;
if (result.StartsWith(separator))
result = result.Substring(separator.Length);
return result;
}