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

◆ ReflectionTryReadPrimitiveArray()

bool System.Runtime.Serialization.ReflectionReader.ReflectionTryReadPrimitiveArray ( XmlReaderDelegator xmlReader,
XmlObjectSerializerReadContext context,
XmlDictionaryString collectionItemName,
XmlDictionaryString collectionItemNamespace,
Type type,
Type itemType,
int arraySize,
[NotNullWhen(true)] out object resultArray )
inlineprivateinherited

Definition at line 521 of file ReflectionReader.cs.

522 {
523 resultArray = null;
524 PrimitiveDataContract primitiveDataContract = PrimitiveDataContract.GetPrimitiveDataContract(itemType);
525 if (primitiveDataContract == null)
526 {
527 return false;
528 }
529 switch (itemType.GetTypeCode())
530 {
531 case TypeCode.Boolean:
532 {
533 if (xmlReader.TryReadBooleanArray(context, collectionItemName, collectionItemNamespace, arraySize, out var array6))
534 {
536 }
537 break;
538 }
539 case TypeCode.DateTime:
540 {
541 if (xmlReader.TryReadDateTimeArray(context, collectionItemName, collectionItemNamespace, arraySize, out var array2))
542 {
544 }
545 break;
546 }
547 case TypeCode.Decimal:
548 {
549 if (xmlReader.TryReadDecimalArray(context, collectionItemName, collectionItemNamespace, arraySize, out var array4))
550 {
552 }
553 break;
554 }
555 case TypeCode.Int32:
556 {
558 {
560 }
561 break;
562 }
563 case TypeCode.Int64:
564 {
566 {
568 }
569 break;
570 }
571 case TypeCode.Single:
572 {
573 if (xmlReader.TryReadSingleArray(context, collectionItemName, collectionItemNamespace, arraySize, out var array3))
574 {
576 }
577 break;
578 }
579 case TypeCode.Double:
580 {
581 if (xmlReader.TryReadDoubleArray(context, collectionItemName, collectionItemNamespace, arraySize, out var array))
582 {
584 }
585 break;
586 }
587 default:
588 return false;
589 }
590 return resultArray != null;
591 }

References System.array, System.Runtime.Serialization.Dictionary, and System.Runtime.Serialization.PrimitiveDataContract.GetPrimitiveDataContract().

Referenced by System.Runtime.Serialization.ReflectionReader.ReflectionReadCollectionCore().