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

◆ ChangeType() [8/9]

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

Definition at line 241 of file XmlDateTimeConverter.cs.

242 {
243 if (value == null)
244 {
245 throw new ArgumentNullException("value");
246 }
247 if (destinationType == null)
248 {
249 throw new ArgumentNullException("destinationType");
250 }
251 Type type = value.GetType();
252 if (destinationType == XmlBaseConverter.ObjectType)
253 {
254 destinationType = base.DefaultClrType;
255 }
256 if (destinationType == XmlBaseConverter.DateTimeType)
257 {
258 return ToDateTime(value);
259 }
260 if (destinationType == XmlBaseConverter.DateTimeOffsetType)
261 {
262 return ToDateTimeOffset(value);
263 }
264 if (destinationType == XmlBaseConverter.StringType)
265 {
266 return ToString(value, nsResolver);
267 }
268 if (destinationType == XmlBaseConverter.XmlAtomicValueType)
269 {
270 if (type == XmlBaseConverter.DateTimeType)
271 {
272 return new XmlAtomicValue(base.SchemaType, (DateTime)value);
273 }
274 if (type == XmlBaseConverter.DateTimeOffsetType)
275 {
276 return new XmlAtomicValue(base.SchemaType, (DateTimeOffset)value);
277 }
278 if (type == XmlBaseConverter.StringType)
279 {
280 return new XmlAtomicValue(base.SchemaType, (string)value);
281 }
282 if (type == XmlBaseConverter.XmlAtomicValueType)
283 {
284 return (XmlAtomicValue)value;
285 }
286 }
287 if (destinationType == XmlBaseConverter.XPathItemType)
288 {
289 if (type == XmlBaseConverter.DateTimeType)
290 {
291 return new XmlAtomicValue(base.SchemaType, (DateTime)value);
292 }
293 if (type == XmlBaseConverter.DateTimeOffsetType)
294 {
295 return new XmlAtomicValue(base.SchemaType, (DateTimeOffset)value);
296 }
297 if (type == XmlBaseConverter.StringType)
298 {
299 return new XmlAtomicValue(base.SchemaType, (string)value);
300 }
301 if (type == XmlBaseConverter.XmlAtomicValueType)
302 {
303 return (XmlAtomicValue)value;
304 }
305 }
307 }
virtual object ChangeListType(object value, Type destinationType, IXmlNamespaceResolver nsResolver)
XmlBaseConverter(XmlSchemaType schemaType)
override DateTimeOffset ToDateTimeOffset(DateTime value)
override DateTime ToDateTime(DateTimeOffset value)

References System.Xml.Schema.XmlBaseConverter.ChangeListType(), System.Xml.Schema.XmlBaseConverter.DateTimeOffsetType, System.Xml.Schema.XmlBaseConverter.DateTimeType, System.Xml.Dictionary, System.Type.GetType(), System.Xml.Schema.XmlBaseConverter.ObjectType, System.Xml.Schema.XmlBaseConverter.StringType, System.Xml.Schema.XmlDateTimeConverter.ToDateTime(), System.Xml.Schema.XmlDateTimeConverter.ToDateTimeOffset(), System.ToString, System.type, System.value, System.Xml.Schema.XmlBaseConverter.XmlAtomicValueType, and System.Xml.Schema.XmlBaseConverter.XPathItemType.