本文整理汇总了C#中RadTreeNode.ExpandParentNodes方法的典型用法代码示例。如果您正苦于以下问题:C# RadTreeNode.ExpandParentNodes方法的具体用法?C# RadTreeNode.ExpandParentNodes怎么用?C# RadTreeNode.ExpandParentNodes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RadTreeNode
的用法示例。
在下文中一共展示了RadTreeNode.ExpandParentNodes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitWebServiceNodes
protected void InitWebServiceNodes(XmlDocument doc, string event_field, RadTreeNode url_node,
RadTreeNode WebServiceResponseRoot, XmlNode phone_data_requests)
{
string url = url_node.Text;
url_node.ExpandParentNodes();
url_node.CollapseChildNodes();
Hashtable WebServiceMethodInputs = new Hashtable();
Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
State["WebServiceMethodInputs"] = WebServiceMethodInputs;
RadTreeNode out_url = new RadTreeNode(url);
out_url.CssClass = "RadTreeView";
out_url.ImageUrl = "~/images/dialog.gif";
WebServiceResponseRoot.Nodes.Add(out_url);
Util util = new Util();
if (!url.EndsWith("?WSDL"))
url += "?WSDL";
string xml = util.GetWebPage(url);
if (xml == null)
{
SaveRequestMessage.Text = "Accessing " + url + " resulted in an error";
return;
}
XmlDocument WebDoc = new XmlDocument();
WebDoc.LoadXml(xml);
XmlNamespaceManager nsmgr = new XmlNamespaceManager(WebDoc.NameTable);
nsmgr.AddNamespace("s", "http://www.w3.org/2001/XMLSchema");
XmlNodeList web_methods = WebDoc.SelectNodes("//s:schema/s:element", nsmgr);
if (web_methods.Count == 0)
{
nsmgr.AddNamespace("wsdl", "http://schemas.xmlsoap.org/wsdl/");
web_methods = WebDoc.SelectNodes("//wsdl:operation", nsmgr);
if (web_methods.Count == 0)
{
SaveRequestMessage.Text = "Could not find any methods with URL: " + url;
return;
}
}
Hashtable used_names = new Hashtable();
foreach (XmlNode web_method in web_methods)
{
//throw out certain methods with <s:any />
if (web_method.InnerXml.Contains("s:any"))
continue;
string web_method_name = web_method.Attributes["name"].Value;
if (used_names.ContainsKey(web_method_name))
continue;
used_names[web_method_name] = true;
ArrayList MethodInputs = new ArrayList();
string service_url = out_url.Text;
if (out_url.Text.ToLower().EndsWith("?wsdl"))
service_url = service_url.Remove(url.Length - 5);
WebServiceMethodInputs[service_url + "/" + web_method_name] = MethodInputs;
RadTreeNode in_method_node = new RadTreeNode(web_method_name);
in_method_node.CssClass = "RadTreeView";
in_method_node.ImageUrl = "~/images/forward_nav.gif";
url_node.Nodes.Add(in_method_node);
//response web methods
XmlNode mapped_node = phone_data_requests.SelectSingleNode("//event_field[.='" + event_field + "']");
RadTreeNode out_method_node = null;
if (mapped_node != null && State["WebServiceTestDoc"] != null && State["WebServiceResponseTreeViewNodeText"] != null &&
State["WebServiceResponseTreeViewNodeText"].ToString() == web_method_name)
{
//make sure we are in the right event
XmlNode method_node = mapped_node.ParentNode.SelectSingleNode("method");
if (method_node != null && method_node.InnerText == web_method_name)
{
XmlDocument TestDoc = (XmlDocument) State["WebServiceTestDoc"];
out_method_node = new RadTreeNode(web_method_name);
State["WebServiceResponseTreeViewMethodText"] = web_method_name;
out_method_node.CssClass = "RadTreeView";
out_method_node.ImageUrl = "~/images/backward_nav.gif";
out_method_node.Category = "method";
out_method_node.Value = service_url + ";" + web_method_name + ";";
out_url.Nodes.Add(out_method_node);
out_method_node.Value.Remove(out_method_node.Value.Length - 1, 1);
WebServiceResponseTreeView.ExpandAllNodes();
XmlToTreeViewNode(TestDoc.FirstChild.NextSibling, out_method_node, web_method_name);
out_method_node.ExpandParentNodes();
Session.Remove("WebServiceTestDoc");
}
}
else if (mapped_node != null)
{
XmlNode web_service_node = mapped_node.ParentNode.SelectSingleNode("web_service[.='" + service_url + "']");
XmlNode method_node = mapped_node.ParentNode.SelectSingleNode("method[.='" + web_method_name + "']");
if (web_service_node != null && method_node != null)
{
in_method_node.BackColor = Color.LightCoral;
out_method_node = new RadTreeNode(web_method_name);
out_method_node.CssClass = "RadTreeView";
out_method_node.ImageUrl = "~/images/backward_nav.gif";
out_method_node.Category = "method";
//.........这里部分代码省略.........