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

◆ GetBooleanAttribute() [1/2]

static bool System.Data.XMLSchema.GetBooleanAttribute ( XmlElement element,
string attrName,
string attrNS,
bool defVal )
inlinestaticpackageinherited

Definition at line 77 of file XMLSchema.cs.

78 {
79 string attribute = element.GetAttribute(attrName, attrNS);
80 if (attribute == null || attribute.Length == 0)
81 {
82 return defVal;
83 }
84 switch (attribute)
85 {
86 case "true":
87 case "1":
88 return true;
89 case "false":
90 case "0":
91 return false;
92 default:
93 throw ExceptionBuilder.InvalidAttributeValue(attrName, attribute);
94 }
95 }
virtual string GetAttribute(string name)

References System.Xml.Dictionary, System.Xml.XmlElement.GetAttribute(), and System.Data.ExceptionBuilder.InvalidAttributeValue().

Referenced by System.Data.XmlDataLoader.LoadRowData().