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