AGS.Types.SerializeUtils.GetChildNodes C# (CSharp) 메소드

GetChildNodes() 공개 정적인 메소드

Wrapper function for SelectSingleNode that throws an exception mentioning the node name if it is not found. Returns the node's children if successful.
public static GetChildNodes ( XmlNode parent, string elementName ) : XmlNodeList
parent System.Xml.XmlNode
elementName string
리턴 System.Xml.XmlNodeList
        public static XmlNodeList GetChildNodes(XmlNode parent, string elementName)
        {
            XmlNode foundNode = parent.SelectSingleNode(elementName);
            if (foundNode == null)
            {
                throw new InvalidDataException("Missing XML element: " + elementName);
            }
            return foundNode.ChildNodes;
        }

Usage Example

예제 #1
0
 public TextParser(XmlNode node)
 {
     foreach (XmlNode wordNode in SerializeUtils.GetChildNodes(node, "Words"))
     {
         _words.Add(new TextParserWord(wordNode));
     }
 }
All Usage Examples Of AGS.Types.SerializeUtils::GetChildNodes