12 instantiations of CollectionDataContract
System.Private.DataContractSerialization (12)
System\Runtime\Serialization\CollectionDataContract.cs (8)
978dataContract = new CollectionDataContract(type); 1098dataContract = new CollectionDataContract(type, (CollectionKind)(i + 1), itemType, getEnumeratorMethod, addMethod, null/*defaultCtor*/); 1193new CollectionDataContract(type, kind, itemType, getEnumeratorMethod, serializationExceptionMessage, deserializationExceptionMessage) : 1194new CollectionDataContract(type, kind, itemType, getEnumeratorMethod, addMethod, defaultCtor, !constructorRequired); 1238new CollectionDataContract(type, kind, itemType, getEnumeratorMethod, serializationExceptionMessage, deserializationExceptionMessage) : 1239new CollectionDataContract(type, kind, itemType, getEnumeratorMethod, addMethod, defaultCtor, !constructorRequired); 1265dataContract = new CollectionDataContract(type, GetInvalidCollectionMessage(message, SR.Format(SR.InvalidCollectionType, DataContract.GetClrTypeFullName(type)), param)); 1397CollectionDataContract boundCollectionContract = new CollectionDataContract(boundType);
System\Runtime\Serialization\DataContract.cs (3)
460dataContract = new CollectionDataContract(type); 738dataContract = new CollectionDataContract(type); 851dataContract = new CollectionDataContract(typeof(Array));
System\Runtime\Serialization\SchemaImporter.cs (1)
1051CollectionDataContract dataContract = new CollectionDataContract(Globals.TypeOfSchemaDefinedType, CollectionKind.Array);
133 references to CollectionDataContract
System.Private.DataContractSerialization (133)
System\Runtime\Serialization\ClassDataContract.cs (3)
326if (CollectionDataContract.IsCollectionInterface(interfaceType)) 649if (baseContract is CollectionDataContract collectionDC) 965if (CollectionDataContract.IsCollection(memberContract.MemberType, false /*isConstructorRequired*/, skipIfReadOnlyContract) && !memberContract.MemberType.IsValueType)
System\Runtime\Serialization\CollectionDataContract.cs (3)
72internal const string ContractTypeString = nameof(CollectionDataContract); 1397CollectionDataContract boundCollectionContract = new CollectionDataContract(boundType); 1540if (other is CollectionDataContract dataContract)
System\Runtime\Serialization\DataContract.cs (6)
472if (!CollectionDataContract.TryCreate(type, out dataContract)) 519if (!CollectionDataContract.TryCreateGetOnlyCollectionDataContract(type, out dataContract)) 580if (type.IsInterface && !CollectionDataContract.IsCollectionInterface(type)) 1110if (CollectionDataContract.IsCollection(type, out Type? itemType)) 1294if (CollectionDataContract.IsCollection(type, out Type? itemType)) 2024if (DataContract.GetDataContract(type) is CollectionDataContract collectionDataContract && collectionDataContract.IsDictionary &&
System\Runtime\Serialization\DataContractSerializer.cs (1)
426if (declaredType.IsInterface && CollectionDataContract.IsCollectionInterface(declaredType))
System\Runtime\Serialization\DataContractSet.cs (6)
128else if (dataContract is CollectionDataContract collectionDC) 175private void AddCollectionDataContract(CollectionDataContract collectionDataContract) 293internal DataContract GetItemTypeDataContract(CollectionDataContract collectionContract) 418CollectionDataContract.IsCollection(type, out _) || 536if (CollectionDataContract.IsCollection(type)) 542else if (dataContract is CollectionDataContract)
System\Runtime\Serialization\Globals.cs (2)
290s_typeOfDictionaryEnumerator ??= typeof(CollectionDataContract.DictionaryEnumerator); 294s_typeOfGenericDictionaryEnumerator ??= typeof(CollectionDataContract.GenericDictionaryEnumerator<,>);
System\Runtime\Serialization\Json\DataContractJsonSerializer.cs (1)
562while (CollectionDataContract.IsCollection(typeToCheck, out itemType))
System\Runtime\Serialization\Json\JsonCollectionDataContract.cs (5)
20public JsonCollectionDataContract(CollectionDataContract traditionalDataContract) 125private CollectionDataContract TraditionalCollectionDataContract => _helper.TraditionalCollectionDataContract; 164private readonly CollectionDataContract _traditionalCollectionDataContract; 168public JsonCollectionDataContractCriticalHelper(CollectionDataContract traditionalDataContract) 192internal CollectionDataContract TraditionalCollectionDataContract
System\Runtime\Serialization\Json\JsonDataContract.cs (6)
262else if (traditionalDataContractType == typeof(CollectionDataContract)) 264dataContract = new JsonCollectionDataContract((CollectionDataContract)traditionalDataContract); 287CollectionDataContract? collectionDataContract = knownDataContract.Value as CollectionDataContract; 302if (!(itemContract is CollectionDataContract)) 306collectionDataContract = itemContract as CollectionDataContract;
System\Runtime\Serialization\Json\JsonFormatGeneratorStatics.cs (1)
141s_getItemContractMethod = typeof(CollectionDataContract).GetProperty("ItemContract", Globals.ScanAllMembers)!.GetGetMethod(nonPublic: true);
System\Runtime\Serialization\Json\JsonFormatReaderGenerator.cs (13)
18internal delegate object JsonFormatCollectionReaderDelegate(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContextComplexJson context, XmlDictionaryString emptyDictionaryString, XmlDictionaryString itemName, CollectionDataContract collectionContract); 19internal delegate void JsonFormatGetOnlyCollectionReaderDelegate(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContextComplexJson context, XmlDictionaryString emptyDictionaryString, XmlDictionaryString itemName, CollectionDataContract collectionContract); 39public JsonFormatCollectionReaderDelegate GenerateCollectionReader(CollectionDataContract collectionContract) 46public JsonFormatGetOnlyCollectionReaderDelegate GenerateGetOnlyCollectionReader(CollectionDataContract collectionContract) 127public JsonFormatCollectionReaderDelegate GenerateCollectionReader(CollectionDataContract collectionContract) 138public JsonFormatGetOnlyCollectionReaderDelegate GenerateGetOnlyCollectionReader(CollectionDataContract collectionContract) 146private CodeGenerator GenerateCollectionReaderHelper(CollectionDataContract collectionContract, bool isGetOnlyCollection) 599private void ReadCollection(CollectionDataContract collectionContract) 726private void ReadSimpleDictionary(CollectionDataContract collectionContract, Type keyValueType) 820private void ReadGetOnlyCollection(CollectionDataContract collectionContract) 962private LocalBuilder ReadCollectionItem(CollectionDataContract collectionContract, Type itemType) 986private void StoreCollectionValue(LocalBuilder collection, LocalBuilder value, CollectionDataContract collectionContract) 1018private void StoreKeyValuePair(LocalBuilder collection, CollectionDataContract collectionContract, LocalBuilder pairKey, LocalBuilder pairValue)
System\Runtime\Serialization\Json\JsonFormatWriterGenerator.cs (6)
17internal delegate void JsonFormatCollectionWriterDelegate(XmlWriterDelegator xmlWriter, object obj, XmlObjectSerializerWriteContextComplexJson context, CollectionDataContract dataContract); 37internal JsonFormatCollectionWriterDelegate GenerateCollectionWriter(CollectionDataContract collectionContract) 84internal JsonFormatCollectionWriterDelegate GenerateCollectionWriter(CollectionDataContract collectionContract) 308private void WriteCollection(CollectionDataContract collectionContract) 409moveNextMethod ??= CollectionDataContract.GetTargetMethodWithName(Globals.MoveNextMethodName, enumeratorType, ienumeratorInterface)!; 410getCurrentMethod ??= CollectionDataContract.GetTargetMethodWithName(Globals.GetCurrentMethodName, enumeratorType, ienumeratorInterface)!;
System\Runtime\Serialization\Json\ReflectionJsonFormatReader.cs (7)
45public object ReflectionReadCollection(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContextComplexJson context, XmlDictionaryString emptyDictionaryString, XmlDictionaryString itemName, CollectionDataContract collectionContract) 52public void ReflectionReadGetOnlyCollection(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContextComplexJson context, XmlDictionaryString emptyDictionaryString, XmlDictionaryString itemName, CollectionDataContract collectionContract) 105protected override string GetCollectionContractItemName(CollectionDataContract collectionContract) 110protected override string GetCollectionContractNamespace(CollectionDataContract collectionContract) 117protected override object? ReflectionReadDictionaryItem(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context, CollectionDataContract collectionContract) 130protected override bool ReflectionReadSpecialCollection(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context, CollectionDataContract collectionContract, object? resultCollection) 147private void ReadSimpleDictionary(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context, CollectionDataContract collectionContract, Type keyValueType, object? dictionary)
System\Runtime\Serialization\Json\ReflectionJsonFormatWriter.cs (1)
31public static void ReflectionWriteCollection(XmlWriterDelegator xmlWriter, object obj, XmlObjectSerializerWriteContextComplexJson context, CollectionDataContract collectionContract)
System\Runtime\Serialization\Json\XmlObjectSerializerWriteContextComplexJson.cs (9)
179if (isDeclaredTypeInterface && CollectionDataContract.IsCollectionInterface(declaredType)) 208if ((declaredType != dataContract.UnderlyingType) && (dataContract is CollectionDataContract)) 215if (((CollectionDataContract)dataContract).Kind == CollectionKind.Dictionary) 248if (!(isDeclaredTypeInterface && CollectionDataContract.IsCollectionInterface(declaredType)) 328if ((contractType == typeof(CollectionDataContract)) && !CollectionDataContract.IsCollectionInterface(declaredType)) 408CollectionDataContract? collectionContract = rootTypeDataContract as CollectionDataContract; 425collectionContract = itemContract as CollectionDataContract;
System\Runtime\Serialization\KnownTypeDataContractResolver.cs (1)
31if (declaredType != null && declaredType.IsInterface && CollectionDataContract.IsCollectionInterface(declaredType))
System\Runtime\Serialization\ReflectionReader.cs (17)
20private delegate object? CollectionReadItemDelegate(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context, CollectionDataContract collectionContract, Type itemType, string itemName, string itemNs); 69public void ReflectionReadGetOnlyCollection(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context, XmlDictionaryString collectionItemName, XmlDictionaryString collectionItemNamespace, CollectionDataContract collectionContract) 92public object ReflectionReadCollection(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context, XmlDictionaryString collectionItemName, XmlDictionaryString collectionItemNamespace, CollectionDataContract collectionContract) 99private object ReflectionReadCollectionCore(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context, XmlDictionaryString collectionItemName, XmlDictionaryString collectionItemNamespace, CollectionDataContract collectionContract) 125private CollectionReadItemDelegate GetCollectionReadItemDelegate(CollectionDataContract collectionContract) 140object? GetReadDictionaryItemDelegate(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context, CollectionDataContract collectionContract, Type itemType, string itemName, string itemNs) 148private object ReadCollectionItems(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context, XmlDictionaryString collectionItemName, XmlDictionaryString collectionItemNamespace, CollectionDataContract collectionContract, object resultCollection, bool isReadOnlyCollection) 199protected abstract object? ReflectionReadDictionaryItem(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context, CollectionDataContract collectionContract); 200protected abstract string GetCollectionContractItemName(CollectionDataContract collectionContract); 201protected abstract string GetCollectionContractNamespace(CollectionDataContract collectionContract); 206protected virtual bool ReflectionReadSpecialCollection(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context, CollectionDataContract collectionContract, object? resultCollection) 365object? GetReadItemOfPrimitiveTypeDelegate(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context, CollectionDataContract collectionContract, Type itemType, string itemName, string itemNs) 393private object? ReflectionInternalDeserialize(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context, CollectionDataContract? collectionContract, Type type, string name, string ns) 453private static bool IsArrayLikeInterface(CollectionDataContract collectionContract) 471private static bool IsArrayLikeCollection(CollectionDataContract collectionContract) 478private static object ReflectionCreateCollection(CollectionDataContract collectionContract) 526private static CollectionSetItemDelegate GetCollectionSetItemDelegate<T>(CollectionDataContract collectionContract, object resultCollectionObject, bool isReadOnlyCollection)
System\Runtime\Serialization\ReflectionXmlFormatReader.cs (5)
44public object ReflectionReadCollection(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context, XmlDictionaryString itemName, XmlDictionaryString itemNamespace, CollectionDataContract collectionContract) 51public void ReflectionReadGetOnlyCollection(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context, XmlDictionaryString itemName, XmlDictionaryString itemNs, CollectionDataContract collectionContract) 112protected override string GetCollectionContractItemName(CollectionDataContract collectionContract) 117protected override string GetCollectionContractNamespace(CollectionDataContract collectionContract) 124protected override object? ReflectionReadDictionaryItem(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context, CollectionDataContract collectionContract)
System\Runtime\Serialization\ReflectionXmlFormatWriter.cs (1)
28public static void ReflectionWriteCollection(XmlWriterDelegator xmlWriter, object obj, XmlObjectSerializerWriteContext context, CollectionDataContract collectionDataContract)
System\Runtime\Serialization\SchemaExporter.cs (6)
95else if (dataContract is CollectionDataContract) 96ExportCollectionDataContract((CollectionDataContract)dataContract, schema); 254while (CollectionDataContract.IsCollection(clrType, out itemType)) 257|| CollectionDataContract.IsCollectionDataContract(clrType)) 361private void ExportCollectionDataContract(CollectionDataContract collectionDataContract, XmlSchema schema) 367if (collectionDataContract.UnderlyingType.IsGenericType && CollectionDataContract.IsCollectionDataContract(collectionDataContract.UnderlyingType))
System\Runtime\Serialization\SchemaImporter.cs (5)
188while (dataContract is CollectionDataContract) 192dataContract = ((CollectionDataContract)dataContract).ItemContract; 199dataContract = ((CollectionDataContract)dataContract).ItemContract; 1049private CollectionDataContract ImportCollection(XmlQualifiedName typeName, XmlSchemaSequence rootSequence, XmlSchemaAnnotation? annotation, bool isReference) 1051CollectionDataContract dataContract = new CollectionDataContract(Globals.TypeOfSchemaDefinedType, CollectionKind.Array);
System\Runtime\Serialization\XmlFormatGeneratorStatics.cs (5)
84s_dictionaryEnumeratorCtor = typeof(CollectionDataContract.DictionaryEnumerator).GetConstructor(Globals.ScanAllMembers, new Type[] { Globals.TypeOfIDictionaryEnumerator }); 127s_getItemContractMethod = typeof(CollectionDataContract).GetProperty("ItemContract", Globals.ScanAllMembers)!.GetMethod; 940s_collectionItemNameProperty = typeof(CollectionDataContract).GetProperty("CollectionItemName", Globals.ScanAllMembers); 955s_childElementNamespaceProperty = typeof(CollectionDataContract).GetProperty("ChildElementNamespace", Globals.ScanAllMembers); 1095s_collectionSerializationExceptionMessageProperty = typeof(CollectionDataContract).GetProperty("SerializationExceptionMessage", Globals.ScanAllMembers);
System\Runtime\Serialization\XmlFormatReaderGenerator.cs (11)
22internal delegate object XmlFormatCollectionReaderDelegate(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context, XmlDictionaryString itemName, XmlDictionaryString itemNamespace, CollectionDataContract collectionContract); 23internal delegate void XmlFormatGetOnlyCollectionReaderDelegate(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context, XmlDictionaryString itemName, XmlDictionaryString itemNamespace, CollectionDataContract collectionContract); 43public XmlFormatCollectionReaderDelegate GenerateCollectionReader(CollectionDataContract collectionContract) 50public XmlFormatGetOnlyCollectionReaderDelegate GenerateGetOnlyCollectionReader(CollectionDataContract collectionContract) 172public XmlFormatCollectionReaderDelegate GenerateCollectionReader(CollectionDataContract collectionContract) 197public XmlFormatGetOnlyCollectionReaderDelegate GenerateGetOnlyCollectionReader(CollectionDataContract collectionContract) 212private CodeGenerator GenerateCollectionReaderHelper(CollectionDataContract collectionContract, bool isGetOnlyCollection) 633private void ReadCollection(CollectionDataContract collectionContract) 775private void ReadGetOnlyCollection(CollectionDataContract collectionContract) 890private LocalBuilder ReadCollectionItem(CollectionDataContract collectionContract, Type itemType, string itemName, string itemNs) 913private void StoreCollectionValue(LocalBuilder collection, LocalBuilder value, CollectionDataContract collectionContract)
System\Runtime\Serialization\XmlFormatWriterGenerator.cs (6)
21internal delegate void XmlFormatCollectionWriterDelegate(XmlWriterDelegator xmlWriter, object obj, XmlObjectSerializerWriteContext context, CollectionDataContract dataContract); 40internal XmlFormatCollectionWriterDelegate GenerateCollectionWriter(CollectionDataContract collectionContract) 118internal XmlFormatCollectionWriterDelegate GenerateCollectionWriter(CollectionDataContract collectionContract) 374private void WriteCollection(CollectionDataContract collectionContract) 488moveNextMethod ??= CollectionDataContract.GetTargetMethodWithName(Globals.MoveNextMethodName, enumeratorType, ienumeratorInterface)!; 489getCurrentMethod ??= CollectionDataContract.GetTargetMethodWithName(Globals.GetCurrentMethodName, enumeratorType, ienumeratorInterface)!;
System\Runtime\Serialization\XmlObjectSerializerContext.cs (3)
287CollectionDataContract? collectionContract = rootTypeDataContract as CollectionDataContract; 295collectionContract = itemContract as CollectionDataContract;
System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (1)
694else if (dataContract is CollectionDataContract)
System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs (2)
151if (declaredType.IsInterface && CollectionDataContract.IsCollectionInterface(declaredType)) 171if (declaredType.IsInterface && CollectionDataContract.IsCollectionInterface(declaredType))