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


C# IXmlNode.SelectNodes方法代码示例

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


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

示例1: LoadConferenceDayData

        private void LoadConferenceDayData(IXmlNode nodeDay)
        {
            Day day = new Day();
            day.Index = int.Parse(nodeDay.Attributes.GetNamedItem("index").InnerText);
            day.Date = DateTime.Parse(nodeDay.Attributes.GetNamedItem("date").InnerText);
            Conference.Days.Add(day);

            XmlNodeList nodesRooms = nodeDay.SelectNodes("room");
            foreach (IXmlNode item in nodesRooms)
            {
                LoadConferenceRoomData(item, day);
            }
        }
开发者ID:julianls,项目名称:FOSDEM,代码行数:13,代码来源:ModelLoader.cs

示例2: GetLocalUrl

        public static LibrelioLocalUrl GetLocalUrl(IXmlNode mag)
        {
            if (mag == null) return null;

            if (mag.ChildNodes.Count > 0)
            {
                var index = Convert.ToInt32(mag.SelectNodes("index")[0].InnerText);
                var title = mag.SelectNodes("title")[0].InnerText;
                var subtitle = mag.SelectNodes("subtitle")[0].InnerText;
                var path = mag.SelectNodes("path")[0].InnerText;
                var pos = 0;
                if (path != "" && path != "ND")
                {
                    pos = path.LastIndexOf('\\');
                    path = path.Substring(0, pos + 1);
                }
                var metadata = mag.SelectNodes("metadata")[0].InnerText;
                pos = metadata.LastIndexOf('\\');
                metadata = metadata.Substring(pos + 1);
                var u = mag.SelectNodes("url")[0].InnerText;
                var rel = mag.SelectNodes("relPath")[0].InnerText;
                var isd = mag.SelectNodes("sampledownloaded")[0].InnerText;

                return new LibrelioLocalUrl(index, title, subtitle, path, GetFullNameFromUrl(rel), u, rel, isd.Equals("true"));
            }
            else
            {
                return null;
            }
        }
开发者ID:modulexcite,项目名称:windows8,代码行数:30,代码来源:DownloadManager.cs

示例3: ParsePredictionsXml

        protected NextbusPredictions ParsePredictionsXml(IXmlNode predictionsNode)
        {
            NextbusPredictions predictions = new NextbusPredictions();

            predictions.AgencyTitle = GetAttributeValue("agencyTitle", predictionsNode.Attributes);
            predictions.RouteTag = GetAttributeValue("routeTag", predictionsNode.Attributes);
            predictions.RouteTitle = GetAttributeValue("routeTitle", predictionsNode.Attributes);
            predictions.StopTag = GetAttributeValue("stopTag", predictionsNode.Attributes);
            predictions.StopTitle = GetAttributeValue("stopTitle", predictionsNode.Attributes);
            predictions.Directions = new List<NextbusPredictionsDirection>();
            // TODO

            predictions.Messages = new List<NextbusMessage>();
            foreach (var messageNode in predictionsNode.SelectNodes("message"))
            {
                predictions.Messages.Add(new NextbusMessage()
                {
                    Text = GetAttributeValue("text", messageNode.Attributes),
                    Priority = GetAttributeValue("priority", messageNode.Attributes)
                });
            }

            return predictions;
        }
开发者ID:ryanvalentin,项目名称:municpl,代码行数:24,代码来源:NextbusDataService.cs

示例4: LoadConferenceRoomData

        private void LoadConferenceRoomData(IXmlNode nodeRoom, Day day)
        {
            string roomName = nodeRoom.Attributes.GetNamedItem("name").InnerText;
            Room room = Conference.Rooms.FirstOrDefault(item => item.Name == roomName);
            if(room == null)
            {
                room = new Room() { Name = roomName };
                Conference.Rooms.Add(room);
            }

            XmlNodeList nodesEvents = nodeRoom.SelectNodes("event");
            foreach (IXmlNode item in nodesEvents)
            {
                LoadConferenceEventData(item, day, room);
            }
        }
开发者ID:julianls,项目名称:FOSDEM,代码行数:16,代码来源:ModelLoader.cs


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