本文整理汇总了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);
}
}
示例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;
}
}
示例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;
}
示例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);
}
}