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

◆ ChangeType() [8/9]

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

Definition at line 212 of file XmlNumeric2Converter.cs.

213 {
214 if (value == null)
215 {
216 throw new ArgumentNullException("value");
217 }
218 if (destinationType == null)
219 {
220 throw new ArgumentNullException("destinationType");
221 }
222 Type type = value.GetType();
223 if (destinationType == XmlBaseConverter.ObjectType)
224 {
225 destinationType = base.DefaultClrType;
226 }
227 if (destinationType == XmlBaseConverter.DoubleType)
228 {
229 return ToDouble(value);
230 }
231 if (destinationType == XmlBaseConverter.SingleType)
232 {
233 return ToSingle(value);
234 }
235 if (destinationType == XmlBaseConverter.StringType)
236 {
237 return ToString(value, nsResolver);
238 }
239 if (destinationType == XmlBaseConverter.XmlAtomicValueType)
240 {
241 if (type == XmlBaseConverter.DoubleType)
242 {
243 return new XmlAtomicValue(base.SchemaType, (double)value);
244 }
245 if (type == XmlBaseConverter.SingleType)
246 {
247 return new XmlAtomicValue(base.SchemaType, value);
248 }
249 if (type == XmlBaseConverter.StringType)
250 {
251 return new XmlAtomicValue(base.SchemaType, (string)value);
252 }
253 if (type == XmlBaseConverter.XmlAtomicValueType)
254 {
255 return (XmlAtomicValue)value;
256 }
257 }
258 if (destinationType == XmlBaseConverter.XPathItemType)
259 {
260 if (type == XmlBaseConverter.DoubleType)
261 {
262 return new XmlAtomicValue(base.SchemaType, (double)value);
263 }
264 if (type == XmlBaseConverter.SingleType)
265 {
266 return new XmlAtomicValue(base.SchemaType, value);
267 }
268 if (type == XmlBaseConverter.StringType)
269 {
270 return new XmlAtomicValue(base.SchemaType, (string)value);
271 }
272 if (type == XmlBaseConverter.XmlAtomicValueType)
273 {
274 return (XmlAtomicValue)value;
275 }
276 }
278 }
virtual object ChangeListType(object value, Type destinationType, IXmlNamespaceResolver nsResolver)
XmlBaseConverter(XmlSchemaType schemaType)
override double ToDouble(string value)

References System.Xml.Schema.XmlBaseConverter.ChangeListType(), System.Xml.Dictionary, System.Xml.Schema.XmlBaseConverter.DoubleType, System.Type.GetType(), System.Xml.Schema.XmlBaseConverter.ObjectType, System.Xml.Schema.XmlBaseConverter.SingleType, System.Xml.Schema.XmlBaseConverter.StringType, System.Xml.Schema.XmlNumeric2Converter.ToDouble(), System.Xml.Schema.XmlNumeric2Converter.ToSingle(), System.ToString, System.type, System.value, System.Xml.Schema.XmlBaseConverter.XmlAtomicValueType, and System.Xml.Schema.XmlBaseConverter.XPathItemType.