Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
XmlUntypedConverter.cs
Go to the documentation of this file.
1namespace System.Xml.Schema;
2
3internal sealed class XmlUntypedConverter : XmlListConverter
4{
5 private readonly bool _allowListToList;
6
8
10
12 : base(DatatypeImplementation.UntypedAtomicType)
13 {
14 }
15
21
22 public override bool ToBoolean(string value)
23 {
24 if (value == null)
25 {
26 throw new ArgumentNullException("value");
27 }
29 }
30
31 public override bool ToBoolean(object value)
32 {
33 if (value == null)
34 {
35 throw new ArgumentNullException("value");
36 }
39 {
40 return XmlConvert.ToBoolean((string)value);
41 }
43 }
44
45 public override DateTime ToDateTime(string value)
46 {
47 if (value == null)
48 {
49 throw new ArgumentNullException("value");
50 }
52 }
53
54 public override DateTime ToDateTime(object value)
55 {
56 if (value == null)
57 {
58 throw new ArgumentNullException("value");
59 }
62 {
64 }
66 }
67
68 public override DateTimeOffset ToDateTimeOffset(string value)
69 {
70 if (value == null)
71 {
72 throw new ArgumentNullException("value");
73 }
75 }
76
77 public override DateTimeOffset ToDateTimeOffset(object value)
78 {
79 if (value == null)
80 {
81 throw new ArgumentNullException("value");
82 }
85 {
87 }
89 }
90
91 public override decimal ToDecimal(string value)
92 {
93 if (value == null)
94 {
95 throw new ArgumentNullException("value");
96 }
98 }
99
100 public override decimal ToDecimal(object value)
101 {
102 if (value == null)
103 {
104 throw new ArgumentNullException("value");
105 }
108 {
109 return XmlConvert.ToDecimal((string)value);
110 }
112 }
113
114 public override double ToDouble(string value)
115 {
116 if (value == null)
117 {
118 throw new ArgumentNullException("value");
119 }
120 return XmlConvert.ToDouble(value);
121 }
122
123 public override double ToDouble(object value)
124 {
125 if (value == null)
126 {
127 throw new ArgumentNullException("value");
128 }
131 {
132 return XmlConvert.ToDouble((string)value);
133 }
135 }
136
137 public override int ToInt32(string value)
138 {
139 if (value == null)
140 {
141 throw new ArgumentNullException("value");
142 }
143 return XmlConvert.ToInt32(value);
144 }
145
146 public override int ToInt32(object value)
147 {
148 if (value == null)
149 {
150 throw new ArgumentNullException("value");
151 }
154 {
155 return XmlConvert.ToInt32((string)value);
156 }
158 }
159
160 public override long ToInt64(string value)
161 {
162 if (value == null)
163 {
164 throw new ArgumentNullException("value");
165 }
166 return XmlConvert.ToInt64(value);
167 }
168
169 public override long ToInt64(object value)
170 {
171 if (value == null)
172 {
173 throw new ArgumentNullException("value");
174 }
177 {
178 return XmlConvert.ToInt64((string)value);
179 }
181 }
182
183 public override float ToSingle(string value)
184 {
185 if (value == null)
186 {
187 throw new ArgumentNullException("value");
188 }
189 return XmlConvert.ToSingle(value);
190 }
191
192 public override float ToSingle(object value)
193 {
194 if (value == null)
195 {
196 throw new ArgumentNullException("value");
197 }
200 {
201 return XmlConvert.ToSingle((string)value);
202 }
204 }
205
206 public override string ToString(bool value)
207 {
208 return XmlConvert.ToString(value);
209 }
210
211 public override string ToString(DateTime value)
212 {
214 }
215
216 public override string ToString(DateTimeOffset value)
217 {
219 }
220
221 public override string ToString(decimal value)
222 {
223 return XmlConvert.ToString(value);
224 }
225
226 public override string ToString(double value)
227 {
228 return XmlConvert.ToString(value);
229 }
230
231 public override string ToString(int value)
232 {
233 return XmlConvert.ToString(value);
234 }
235
236 public override string ToString(long value)
237 {
238 return XmlConvert.ToString(value);
239 }
240
241 public override string ToString(float value)
242 {
243 return XmlConvert.ToString(value);
244 }
245
246 public override string ToString(object value, IXmlNamespaceResolver nsResolver)
247 {
248 if (value == null)
249 {
250 throw new ArgumentNullException("value");
251 }
254 {
255 return XmlConvert.ToString((bool)value);
256 }
258 {
259 return XmlConvert.ToString((byte)value);
260 }
262 {
264 }
266 {
268 }
270 {
272 }
274 {
275 return XmlConvert.ToString((decimal)value);
276 }
278 {
279 return XmlConvert.ToString((double)value);
280 }
282 {
283 return XmlConvert.ToString((short)value);
284 }
286 {
287 return XmlConvert.ToString((int)value);
288 }
290 {
291 return XmlConvert.ToString((long)value);
292 }
294 {
295 return XmlConvert.ToString((sbyte)value);
296 }
298 {
299 return XmlConvert.ToString((float)value);
300 }
302 {
303 return (string)value;
304 }
306 {
308 }
310 {
311 return XmlConvert.ToString((ushort)value);
312 }
314 {
315 return XmlConvert.ToString((uint)value);
316 }
318 {
319 return XmlConvert.ToString((ulong)value);
320 }
322 {
324 }
326 {
327 return (string)((XmlAtomicValue)value).ValueAs(XmlBaseConverter.StringType, nsResolver);
328 }
330 {
332 }
334 }
335
336 public override object ChangeType(bool value, Type destinationType)
337 {
338 if (destinationType == null)
339 {
340 throw new ArgumentNullException("destinationType");
341 }
343 {
344 destinationType = base.DefaultClrType;
345 }
347 {
348 return XmlConvert.ToString(value);
349 }
351 }
352
354 {
355 if (destinationType == null)
356 {
357 throw new ArgumentNullException("destinationType");
358 }
360 {
361 destinationType = base.DefaultClrType;
362 }
364 {
366 }
368 }
369
370 public override object ChangeType(decimal value, Type destinationType)
371 {
372 if (destinationType == null)
373 {
374 throw new ArgumentNullException("destinationType");
375 }
377 {
378 destinationType = base.DefaultClrType;
379 }
381 {
382 return XmlConvert.ToString(value);
383 }
385 }
386
387 public override object ChangeType(double value, Type destinationType)
388 {
389 if (destinationType == null)
390 {
391 throw new ArgumentNullException("destinationType");
392 }
394 {
395 destinationType = base.DefaultClrType;
396 }
398 {
399 return XmlConvert.ToString(value);
400 }
402 }
403
404 public override object ChangeType(int value, Type destinationType)
405 {
406 if (destinationType == null)
407 {
408 throw new ArgumentNullException("destinationType");
409 }
411 {
412 destinationType = base.DefaultClrType;
413 }
415 {
416 return XmlConvert.ToString(value);
417 }
419 }
420
421 public override object ChangeType(long value, Type destinationType)
422 {
423 if (destinationType == null)
424 {
425 throw new ArgumentNullException("destinationType");
426 }
428 {
429 destinationType = base.DefaultClrType;
430 }
432 {
433 return XmlConvert.ToString(value);
434 }
436 }
437
439 {
440 if (value == null)
441 {
442 throw new ArgumentNullException("value");
443 }
444 if (destinationType == null)
445 {
446 throw new ArgumentNullException("destinationType");
447 }
449 {
450 destinationType = base.DefaultClrType;
451 }
453 {
454 return XmlConvert.ToBoolean(value);
455 }
457 {
459 }
461 {
463 }
465 {
467 }
469 {
471 }
473 {
474 return XmlConvert.ToDecimal(value);
475 }
477 {
478 return XmlConvert.ToDouble(value);
479 }
481 {
483 }
485 {
486 return XmlConvert.ToInt32(value);
487 }
489 {
490 return XmlConvert.ToInt64(value);
491 }
493 {
495 }
497 {
498 return XmlConvert.ToSingle(value);
499 }
501 {
503 }
505 {
507 }
509 {
511 }
513 {
515 }
517 {
518 return XmlConvert.ToUri(value);
519 }
521 {
522 return new XmlAtomicValue(base.SchemaType, value);
523 }
525 {
527 }
529 {
530 return new XmlAtomicValue(base.SchemaType, value);
531 }
533 {
534 return value;
535 }
537 }
538
540 {
541 if (value == null)
542 {
543 throw new ArgumentNullException("value");
544 }
545 if (destinationType == null)
546 {
547 throw new ArgumentNullException("destinationType");
548 }
551 {
552 destinationType = base.DefaultClrType;
553 }
555 {
556 return XmlConvert.ToBoolean((string)value);
557 }
559 {
561 }
563 {
565 }
567 {
569 }
571 {
573 }
575 {
576 return XmlConvert.ToDecimal((string)value);
577 }
579 {
580 return XmlConvert.ToDouble((string)value);
581 }
583 {
585 }
587 {
588 return XmlConvert.ToInt32((string)value);
589 }
591 {
592 return XmlConvert.ToInt64((string)value);
593 }
595 {
597 }
599 {
600 return XmlConvert.ToSingle((string)value);
601 }
603 {
605 }
607 {
609 }
611 {
613 }
615 {
617 }
619 {
620 return XmlConvert.ToUri((string)value);
621 }
623 {
625 {
626 return new XmlAtomicValue(base.SchemaType, (string)value);
627 }
629 {
630 return (XmlAtomicValue)value;
631 }
632 }
634 {
636 }
638 {
640 {
641 return new XmlAtomicValue(base.SchemaType, (string)value);
642 }
644 {
645 return (XmlAtomicValue)value;
646 }
647 }
649 {
650 return ToString(value, nsResolver);
651 }
653 {
654 return new XmlAtomicValue(base.SchemaType, ToString(value, nsResolver));
655 }
657 {
658 return new XmlAtomicValue(base.SchemaType, ToString(value, nsResolver));
659 }
661 {
663 }
665 }
666
676
689
707
709 {
711 {
712 return true;
713 }
715 {
716 return true;
717 }
719 {
720 return true;
721 }
723 {
724 return true;
725 }
727 {
728 return true;
729 }
731 {
732 return true;
733 }
735 {
736 return true;
737 }
739 {
740 return true;
741 }
743 {
744 return true;
745 }
747 {
748 return true;
749 }
751 {
752 return true;
753 }
755 {
756 return true;
757 }
759 {
760 return true;
761 }
763 {
764 return true;
765 }
767 {
768 return true;
769 }
771 {
772 return true;
773 }
775 {
776 return true;
777 }
779 {
780 return true;
781 }
782 return false;
783 }
784}
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string XmlConvert_TypeToString
Definition SR.cs:382
static string XmlConvert_TypeFromString
Definition SR.cs:384
Definition SR.cs:7
static ? Type GetType(string typeName, bool throwOnError, bool ignoreCase)
Definition Type.cs:408
static ushort Int32ToUInt16(int value)
static short Int32ToInt16(int value)
static readonly Type XmlAtomicValueType
static readonly Type DateTimeOffsetType
static string DurationToString(TimeSpan value)
static sbyte Int32ToSByte(int value)
static uint Int64ToUInt32(long value)
static DateTimeOffset UntypedAtomicToDateTimeOffset(string value)
static string QNameToString(XmlQualifiedName name)
static readonly Type XmlQualifiedNameType
static string DateTimeToString(DateTime value)
static XmlQualifiedName StringToQName(string value, IXmlNamespaceResolver nsResolver)
static DateTime UntypedAtomicToDateTime(string value)
static string DateTimeOffsetToString(DateTimeOffset value)
static string Base64BinaryToString(byte[] value)
static string AnyUriToString(Uri value)
static ulong DecimalToUInt64(decimal value)
static byte[] StringToBase64Binary(string value)
static bool IsDerivedFrom(Type derivedType, Type baseType)
static TimeSpan StringToDuration(string value)
new Exception CreateInvalidClrMappingException(Type sourceType, Type destinationType)
override object ChangeType(object value, Type destinationType, IXmlNamespaceResolver nsResolver)
override object ChangeType(string value, Type destinationType, IXmlNamespaceResolver nsResolver)
override object ChangeType(DateTime value, Type destinationType)
override object ChangeType(decimal value, Type destinationType)
override decimal ToDecimal(string value)
override string ToString(float value)
override bool ToBoolean(string value)
object ChangeTypeWildcardSource(object value, Type destinationType, IXmlNamespaceResolver nsResolver)
override DateTimeOffset ToDateTimeOffset(string value)
override object ChangeListType(object value, Type destinationType, IXmlNamespaceResolver nsResolver)
override DateTime ToDateTime(string value)
override string ToString(double value)
override object ChangeType(int value, Type destinationType)
object ChangeTypeWildcardDestination(object value, Type destinationType, IXmlNamespaceResolver nsResolver)
override string ToString(object value, IXmlNamespaceResolver nsResolver)
override string ToString(DateTime value)
override object ChangeType(long value, Type destinationType)
override object ChangeType(bool value, Type destinationType)
static readonly XmlValueConverter Untyped
override string ToString(DateTimeOffset value)
override float ToSingle(object value)
override double ToDouble(object value)
override object ChangeType(double value, Type destinationType)
override float ToSingle(string value)
override string ToString(decimal value)
override DateTime ToDateTime(object value)
override DateTimeOffset ToDateTimeOffset(object value)
XmlUntypedConverter(XmlUntypedConverter atomicConverter, bool allowListToList)
override bool ToBoolean(object value)
static readonly XmlValueConverter UntypedList
override decimal ToDecimal(object value)
override double ToDouble(string value)
static bool ToBoolean(string s)
static int ToInt32(string s)
static string ToString(bool value)
static float ToSingle(string s)
static double ToDouble(string s)
static Uri ToUri(string s)
static decimal ToDecimal(string s)
static long ToInt64(string s)