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


C# Util.CreateFieldNode方法代码示例

本文整理汇总了C#中Util.CreateFieldNode方法的典型用法代码示例。如果您正苦于以下问题:C# Util.CreateFieldNode方法的具体用法?C# Util.CreateFieldNode怎么用?C# Util.CreateFieldNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Util的用法示例。


在下文中一共展示了Util.CreateFieldNode方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Controls_PageView

    public Controls_PageView(string PageName)
    {
        XmlUtil x_util = new XmlUtil();
        Util util = new Util();
        //get page image
        Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
        PageImage.ImageUrl = util.GetAppPageImage(State, State["PageViewAppID"].ToString(), PageName);
        PageImage.ID = PageName + "_PageImage";
        PageImage.Attributes.Add("onclick", "goToPage('" + PageName + "');");
        PageImage.Attributes.Add("onmouseover", "this.style.cursor='pointer';");
        PageImage.Attributes.Add("onmouseout", "this.style.cursor='arrow';");
        if (State["UseFullPageImage"] != null)
        {
            PageImage.Width = 320;
            PageImage.Height = 460;
        }
        //get page fields
        XmlDocument doc = x_util.GetStagingAppXml(State);
        RadTreeNode PageRoot = new RadTreeNode(PageName);
        PageRoot.CssClass = "RadTreeView";
        PageRoot.ImageUrl = "../images/ascx.gif";
        PageRoot.Category = "page";
        PageRoot.Font.Size = FontUnit.Point(12);
        OnePageView.Nodes.Add(PageRoot);

        //do all fields
        XmlNode page = doc.SelectSingleNode("//pages/page/name[.  ='" + PageName + "']").ParentNode;
        XmlNode fields = page.SelectSingleNode("fields");

        if (fields != null)
        {
            //sort fields first
            SortedList list = new SortedList();
            SortableList<StoryBoardField> nameList = new SortableList<StoryBoardField>();

            foreach (XmlNode child in fields.ChildNodes)
            {
                Hashtable dict = new Hashtable();
                dict["field_type"] = child.Name;
                XmlNode id_node = child.SelectSingleNode("id");
                dict["id"] = id_node;
                string input_field = id_node.InnerText.Trim();
                if (child.SelectSingleNode("left") != null)
                    dict["left"] = child.SelectSingleNode("left").InnerText;
                else
                    dict["left"] = "0";

                if (child.SelectSingleNode("top") != null)
                    dict["top"] = child.SelectSingleNode("top").InnerText;
                else
                    dict["top"] = "0";

                dict["width"] = child.SelectSingleNode("width").InnerText;
                dict["height"] = child.SelectSingleNode("height").InnerText;
                string field_type = dict["field_type"].ToString();
                if (field_type == "button" ||
                    field_type == "image_button" ||
                    field_type == "table" ||
                    field_type == "switch")
                {
                    if(child.SelectSingleNode("submit") != null)
                        dict["submit"] = child.SelectSingleNode("submit").InnerText;
                }
                if (field_type == "table" )
                {
                    XmlNodeList sub_fields = child.SelectNodes("table_fields/table_field/name");
                    ArrayList table_list = new ArrayList();
                    foreach (XmlNode sub_field in sub_fields)
                    {
                        table_list.Add(sub_field.InnerText);
                    }
                    dict["sub_fields"] = table_list;
                }
                else if (field_type == "picker")
                {
                    XmlNodeList sub_fields = child.SelectNodes("picker_fields/picker_field/name");
                    ArrayList picker_list = new ArrayList();
                    foreach (XmlNode sub_field in sub_fields)
                    {
                        picker_list.Add(sub_field.InnerText);
                    }
                    dict["sub_fields"] = picker_list;
                }
                list[input_field] = dict;
                nameList.Add(new StoryBoardField(id_node.InnerText.Trim(), Convert.ToInt32(dict["top"].ToString()), Convert.ToInt32(dict["left"].ToString())));
            }

            nameList.Sort("Top", true);

            foreach (StoryBoardField input_field in nameList)
            {
                Hashtable dict = (Hashtable)list[input_field.FieldName];
                string field_type = dict["field_type"].ToString();
                RadTreeNode field_node = util.CreateFieldNode(PageRoot, input_field.FieldName, field_type);
                field_node.Value = "left:" +  dict["left"].ToString() + ";top:" + dict["top"].ToString() + ";width:" + dict["width"].ToString() + ";height:" + dict["height"].ToString() ;
                if (dict["submit"] != null && dict["submit"].ToString().Length > 0 && dict["submit"].ToString() != ";")
                {
                    field_node.BackColor = Color.PeachPuff;
                    string[] submit = dict["submit"].ToString().Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                    string target_page_name = null;
//.........这里部分代码省略.........
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:101,代码来源:PageView.ascx.cs

示例2: CreateDeviceDataFieldNode

    protected RadTreeNode CreateDeviceDataFieldNode(RadTreeNode PhoneDataFieldsRoot, string input_field, string field_type, Hashtable input_to_event_map)
    {
        Util util = new Util();
        RadTreeNode id = util.CreateFieldNode(PhoneDataFieldsRoot, input_field, field_type);
        if (input_to_event_map.ContainsKey(input_field))
        {
            id.Value = "page:" + PhoneDataFieldsRoot.Text +
                 ";event_field:" + input_to_event_map[input_field].ToString() +
                 ";input_field:" + input_field;
        }
        else
        {
            id.Value = "page:" + PhoneDataFieldsRoot.Text +
                ";input_field:" + input_field;
        }
        if (field_type == "gps_field" ||
            field_type == "table_field" ||
            field_type == "text_field" ||
            field_type == "label" ||
             field_type == "speech_reco" ||
              field_type == "hidden_field" ||
             field_type == "text_area" ||
            field_type == "picker_field")
        {
            id.BackColor = Color.FromArgb(153, 255, 185); //LIGHT GREEN
            id.Category = "request";
        }

        return id;
    }
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:30,代码来源:GoogleSpreadsheetOperations.aspx.cs

示例3: BuildWebServiceDataTrees


//.........这里部分代码省略.........
            {
                PhoneRequestRoot = new RadTreeNode(page_name);
                PhoneRequestRoot.CssClass = "RadTreeView";
                PhoneRequestRoot.ImageUrl = "~/images/ascx.gif";
                PhoneRequestTreeView.Nodes.Add(PhoneRequestRoot);
            }
            if (page_name == to_page || SeeAllPages.Checked)
            {
                PhoneResponseRoot = new RadTreeNode(page_name);
                PhoneResponseRoot.CssClass = "RadTreeView";
                PhoneResponseRoot.ImageUrl = "~/images/ascx.gif";
                PhoneResponseTreeView.Nodes.Add(PhoneResponseRoot);
                PhoneResponseRoot.Category = "page";
            }

            if (page_name != from_page && page_name != to_page && !SeeAllPages.Checked)
                continue;

            //do inputs from phone
            XmlNodeList input_nodes = page.SelectNodes("fields/text_area | fields/label | fields/text_field | fields/hidden_field");

            foreach (XmlNode input_node in input_nodes)
            {
                // phone input field
                XmlNode id_node = input_node.SelectSingleNode("id");
                if (page_name == from_page || SeeAllPages.Checked)
                {
                    string input_field = id_node.InnerText.Trim();
                    CreateInputFieldNode(PhoneRequestRoot, input_field, input_node.Name, phone_data_requests, input_to_event_map);
                }
                else if (page_name == to_page || SeeAllPages.Checked)
                {
                    //phone output field
                    RadTreeNode id = util.CreateFieldNode(PhoneResponseRoot, id_node.InnerText, input_node.Name);
                    id.Category = "output";
                    id.BackColor = Color.FromArgb(250, 252, 156); //yellow

                    CreateWebResponseFieldNode(id, phone_data_requests);

                    AddStatusNodes(id, phone_data_requests, id.Text + "_status");
                }
            }

            if (page_name == from_page || SeeAllPages.Checked)
            {

                XmlNodeList gps_fields = page.SelectNodes("fields/gps");

                foreach (XmlNode gps_field in gps_fields)
                {
                    XmlNode id_node = gps_field.SelectSingleNode("id");
                    string input_field = id_node.InnerText.Trim();
                    RadTreeNode gps_node = CreateInputFieldNode(PhoneRequestRoot, input_field, "gps", phone_data_requests, input_to_event_map);

                    XmlNode part_node = gps_field.SelectSingleNode("latitude");
                    CreateInputFieldNode(gps_node, part_node.InnerText, "gps_field", phone_data_requests, input_to_event_map);
                    part_node = gps_field.SelectSingleNode("longitude");
                    CreateInputFieldNode(gps_node, part_node.InnerText, "gps_field", phone_data_requests, input_to_event_map);
                }
            }

            XmlNodeList pickers = page.SelectNodes("fields/picker");
            foreach (XmlNode picker in pickers)
            {
                XmlNode id_node = picker.SelectSingleNode("id");
                XmlNode fields = picker.SelectSingleNode("picker_fields");
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:67,代码来源:ManageData.aspx.cs

示例4: CreateInputFieldNode

    protected RadTreeNode CreateInputFieldNode(RadTreeNode PhoneRequestRoot, string input_field, string field_type, XmlNode phone_data_requests, Hashtable input_to_event_map)
    {
        bool is_field_mapped = false;
        Util util = new Util();
        XmlNode mapped_node = phone_data_requests.SelectSingleNode("//phone_data_request/event_field[.='" + WebServiceEvents.SelectedItem.Text + "']");
        if (mapped_node != null)
        {
            mapped_node = mapped_node.ParentNode.SelectSingleNode("input_mapping/input_field[.='" + input_field + "']");
            if (mapped_node != null)
                is_field_mapped = true;
        }

        if (!is_field_mapped)
        {
            RadTreeNode id = util.CreateFieldNode(PhoneRequestRoot, input_field, field_type);
            if (input_to_event_map.ContainsKey(input_field))
            {
                id.Value = "page:" + PhoneRequestRoot.Text +
                     ";event_field:" + input_to_event_map[input_field].ToString() +
                     ";input_field:" + input_field;
            }
            else
            {
                id.Value = "page:" + PhoneRequestRoot.Text +
                    ";input_field:" + input_field;
            }
            //id.Style = "background-color:#99ffb9;";
            if (field_type == "gps_field" ||
                field_type == "table_field" ||
                field_type == "text_field" ||
                field_type == "label" ||
                 field_type == "speech_reco" ||
                  field_type == "hidden_field" ||
                 field_type == "text_area" ||
                field_type == "picker_field")
            {
                id.BackColor = Color.FromArgb(153, 255, 185); //LIGHT GREEN
                id.Category = "request";
            }

            return id;
        }
        else
        {
            return null;
        }
    }
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:47,代码来源:ManageData.aspx.cs

示例5: InitWebServiceNodes


//.........这里部分代码省略.........
                  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";
                    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();
                }
            }

            XmlNodeList parms = web_method.SelectNodes("s:complexType/s:sequence/s:element", nsmgr);
            foreach (XmlNode parm in parms)
            {
                string parm_name = parm.Attributes["name"].Value;
                MethodInputs.Add(parm_name);
                if (out_method_node != null)
                    out_method_node.Value += parm_name + ",";
                RadTreeNode parm_node = new RadTreeNode(parm_name);
                parm_node.CssClass = "RadTreeView";
                parm_node.ImageUrl = "~/images/dot.gif";
                parm_node.Category = "input";
                parm_node.BackColor = Color.FromArgb(250, 252, 156);
                in_method_node.Nodes.Add(parm_node);

                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)
                    {
                        XmlNode web_service_method_input_node = mapped_node.ParentNode.SelectSingleNode("input_mapping/web_service_method_input[.='" + parm_name + "']");
                        if (web_service_method_input_node != null)
                        {
                            XmlNode input_field_node = web_service_method_input_node.ParentNode.SelectSingleNode("input_field");
                            if (input_field_node != null)
                            {
                                string request_name = input_field_node.InnerText;
                                XmlNode field_node = doc.SelectSingleNode("//id[.='" + request_name + "']");
                                RadTreeNode request_node = null;
                                if (field_node == null)

                                    request_node = util.CreateFieldNode(parm_node, request_name, "");
                                else
                                    request_node = util.CreateFieldNode(parm_node, request_name, field_node.ParentNode.Name);

                                request_node.Text = request_name;
                                request_node.Category = "request";
                                request_node.BackColor = Color.FromArgb(153, 255, 185); //LIGHT GREEN
                            }
                        }
                    }
                }
            }
            RadTreeNode save_method_node = new RadTreeNode("Save calling this method with 0 or more inputs mapped");
            save_method_node.CssClass = "RadTreeView";
            save_method_node.ImageUrl = "~/images/save.gif";
            save_method_node.Category = "save";
            in_method_node.Nodes.Add(save_method_node);

            RadTreeNode undo_method_inputs_node = new RadTreeNode("Undo mapping of device fields to this method");
            undo_method_inputs_node.CssClass = "RadTreeView";
            undo_method_inputs_node.ImageUrl = "~/images/cancel.png";
            undo_method_inputs_node.Category = "delete";
            in_method_node.Nodes.Add(undo_method_inputs_node);
            in_method_node.ExpandChildNodes();
        }
    }
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:101,代码来源:ManageData.aspx.cs


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