本文整理汇总了C#中System.Xml.XmlElement.GetXmlElement方法的典型用法代码示例。如果您正苦于以下问题:C# XmlElement.GetXmlElement方法的具体用法?C# XmlElement.GetXmlElement怎么用?C# XmlElement.GetXmlElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.XmlElement
的用法示例。
在下文中一共展示了XmlElement.GetXmlElement方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: L4D2Map
public L4D2Map(XmlElement data)
{
string imgurl = data.GetInnerText("img");
ID = imgurl.Substring(0, imgurl.LastIndexOf('/') -4);
Name = data.GetInnerText("name");
Played = data.GetInnerText("hasPlayed").Equals("1");
if (Played) {
BestTime = float.Parse(data.GetInnerText("besttimemilliseconds")) / 1000;
ItemsUsed = new L4D2Items(data);
InfectedKilled = new L4D2Infected(data);
List<SteamID> teammateList = new List<SteamID>();
foreach (XmlElement teammate in data.GetXmlElement("teammates")) {
teammateList.Add(SteamID.Create(long.Parse(teammate.InnerText), false));
}
Teammates = teammateList.ToArray();
Medal = MedalFrom(data.GetInnerText("medal"));
}
}
示例2: L4D2ScavengeStats
public L4D2ScavengeStats(XmlElement data)
{
AverageCansPerRound = float.Parse(data.GetInnerText("avgcansperround"));
PerfectRounds = int.Parse(data.GetInnerText("perfect16canrounds"));
RoundsLost = int.Parse(data.GetInnerText("roundslost"));
RoundsPlayed = int.Parse(data.GetInnerText("roundsplayed"));
RoundsWon = int.Parse(data.GetInnerText("roundswon"));
TotalCans = int.Parse(data.GetInnerText("totalcans"));
List<L4D2ScavengeMapStats> mapList = new List<L4D2ScavengeMapStats>();
foreach (XmlElement map in data.GetXmlElement("mapstats")) {
mapList.Add(new L4D2ScavengeMapStats(map));
}
MapStats = mapList.ToArray();
}
示例3: DefenseGridTower
public DefenseGridTower(XmlElement data)
{
Class = data.Name;
Level = int.Parse(data.GetAttribute("level"));
Built = int.Parse(data.GetValueText("built"));
if (data.GetXmlElement("damage") != null) {
HasDamage = true;
Damage = float.Parse(data.GetValueText("damage"));
}
}