当前位置: 首页>>代码示例>>C#>>正文


C# RadTreeNode.ExpandParentNodes方法代码示例

本文整理汇总了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";
//.........这里部分代码省略.........
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:101,代码来源:ManageData.aspx.cs


注:本文中的RadTreeNode.ExpandParentNodes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。