Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ FindTypeNode()

XmlElement System.Data.XDRSchema.FindTypeNode ( XmlElement node)
inlinepackage

Definition at line 122 of file XDRSchema.cs.

123 {
124 if (XMLSchema.FEqualIdentity(node, "ElementType", "urn:schemas-microsoft-com:xml-data"))
125 {
126 return node;
127 }
128 string attribute = node.GetAttribute("type");
129 if (XMLSchema.FEqualIdentity(node, "element", "urn:schemas-microsoft-com:xml-data") || XMLSchema.FEqualIdentity(node, "attribute", "urn:schemas-microsoft-com:xml-data"))
130 {
131 if (attribute == null || attribute.Length == 0)
132 {
133 return null;
134 }
137 while (xmlNode != ownerDocument)
138 {
139 if (((XMLSchema.FEqualIdentity(xmlNode, "ElementType", "urn:schemas-microsoft-com:xml-data") && XMLSchema.FEqualIdentity(node, "element", "urn:schemas-microsoft-com:xml-data")) || (XMLSchema.FEqualIdentity(xmlNode, "AttributeType", "urn:schemas-microsoft-com:xml-data") && XMLSchema.FEqualIdentity(node, "attribute", "urn:schemas-microsoft-com:xml-data"))) && xmlNode is XmlElement && ((XmlElement)xmlNode).GetAttribute("name") == attribute)
140 {
141 return (XmlElement)xmlNode;
142 }
143 if (xmlNode.FirstChild != null)
144 {
146 continue;
147 }
148 if (xmlNode.NextSibling != null)
149 {
151 continue;
152 }
153 while (xmlNode != ownerDocument)
154 {
156 if (xmlNode.NextSibling != null)
157 {
159 break;
160 }
161 }
162 }
163 return null;
164 }
165 return null;
166 }
virtual string GetAttribute(string name)
virtual ? XmlNode ParentNode
Definition XmlNode.cs:76
virtual ? XmlNode NextSibling
Definition XmlNode.cs:104
virtual ? XmlDocument OwnerDocument
Definition XmlNode.cs:109
virtual ? XmlNode FirstChild
Definition XmlNode.cs:120

References System.Xml.Dictionary, System.Data.XMLSchema.FEqualIdentity(), System.Xml.XmlNode.FirstChild, System.Xml.XmlElement.GetAttribute(), System.Xml.XmlNode.NextSibling, System.Xml.XmlNode.OwnerDocument, and System.Xml.XmlNode.ParentNode.

Referenced by System.Data.XDRSchema.HandleColumn(), and System.Data.XDRSchema.HandleTable().