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

◆ ChangeType() [8/9]

override object System.Xml.Schema.XmlBooleanConverter.ChangeType ( object value,
Type destinationType,
IXmlNamespaceResolver nsResolver )
inline

Definition at line 135 of file XmlBooleanConverter.cs.

136 {
137 if (value == null)
138 {
139 throw new ArgumentNullException("value");
140 }
141 if (destinationType == null)
142 {
143 throw new ArgumentNullException("destinationType");
144 }
145 Type type = value.GetType();
146 if (destinationType == XmlBaseConverter.ObjectType)
147 {
148 destinationType = base.DefaultClrType;
149 }
150 if (destinationType == XmlBaseConverter.BooleanType)
151 {
152 return ToBoolean(value);
153 }
154 if (destinationType == XmlBaseConverter.StringType)
155 {
156 return ToString(value, nsResolver);
157 }
158 if (destinationType == XmlBaseConverter.XmlAtomicValueType)
159 {
160 if (type == XmlBaseConverter.BooleanType)
161 {
162 return new XmlAtomicValue(base.SchemaType, (bool)value);
163 }
164 if (type == XmlBaseConverter.StringType)
165 {
166 return new XmlAtomicValue(base.SchemaType, (string)value);
167 }
168 if (type == XmlBaseConverter.XmlAtomicValueType)
169 {
170 return (XmlAtomicValue)value;
171 }
172 }
173 if (destinationType == XmlBaseConverter.XPathItemType)
174 {
175 if (type == XmlBaseConverter.BooleanType)
176 {
177 return new XmlAtomicValue(base.SchemaType, (bool)value);
178 }
179 if (type == XmlBaseConverter.StringType)
180 {
181 return new XmlAtomicValue(base.SchemaType, (string)value);
182 }
183 if (type == XmlBaseConverter.XmlAtomicValueType)
184 {
185 return (XmlAtomicValue)value;
186 }
187 }
189 }
virtual object ChangeListType(object value, Type destinationType, IXmlNamespaceResolver nsResolver)
XmlBaseConverter(XmlSchemaType schemaType)
override bool ToBoolean(string value)

References System.Xml.Schema.XmlBaseConverter.BooleanType, System.Xml.Schema.XmlBaseConverter.ChangeListType(), System.Xml.Dictionary, System.Type.GetType(), System.Xml.Schema.XmlBaseConverter.ObjectType, System.Xml.Schema.XmlBaseConverter.StringType, System.Xml.Schema.XmlBooleanConverter.ToBoolean(), System.ToString, System.type, System.value, System.Xml.Schema.XmlBaseConverter.XmlAtomicValueType, and System.Xml.Schema.XmlBaseConverter.XPathItemType.