本文整理汇总了C#中XmlNode.Get方法的典型用法代码示例。如果您正苦于以下问题:C# XmlNode.Get方法的具体用法?C# XmlNode.Get怎么用?C# XmlNode.Get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XmlNode
的用法示例。
在下文中一共展示了XmlNode.Get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Load
public override void Load(XmlNode xnode)
{
name = MyXml.GetString(xnode, "name");
type = BigBase.Instance.globalTileTypes.Get(MyXml.GetString(xnode, "type"));
picture = MyXml.GetString(xnode, "picture");
hasTop = MyXml.GetBool(xnode, "top");
string s = xnode.Get<string>("palette");
palette = s == default(string) ? null : Palette.Get(s);
for (XmlNode secondNode = xnode.FirstChild; secondNode != null; secondNode = secondNode.NextSibling)
{
if (secondNode.Name == "components")
for (XmlNode thirdNode = secondNode.FirstChild; thirdNode != null; thirdNode = thirdNode.NextSibling)
components.Add(CraftingComponent.Get(MyXml.GetString(thirdNode, "name")));
else if (secondNode.Name == "items")
for (XmlNode thirdNode = secondNode.FirstChild; thirdNode != null; thirdNode = thirdNode.NextSibling)
{
int amount = MyXml.GetInt(thirdNode, "amount", 1);
string name = MyXml.GetString(thirdNode, "name");
for (int i = 0; i < amount; i++) items.Add(ItemShape.Get(name));
}
}
}