9 instantiations of TypeDesc
System.Private.Xml (9)
System\Xml\Serialization\Types.cs (5)
368
_nullableTypeDesc = new
TypeDesc
($"NullableOf{_name}", $"System.Nullable`1[{_fullName}]", null, TypeKind.Struct, this, _flags | TypeFlags.OptionalValue, _formatterName);
411
internal TypeDesc CreateArrayTypeDesc() => _arrayTypeDesc ??= new
TypeDesc
(null, $"{_name}[]", $"{_fullName}[]", TypeKind.Array, null, TypeFlags.Reference | (_flags & TypeFlags.UseReflection), this);
638
TypeDesc typeDesc = new
TypeDesc
(type, true, dataType, formatterName, flags);
658
TypeDesc typeDesc = new
TypeDesc
(type, false, dataType, formatterName, flags);
924
typeDesc = new
TypeDesc
(type, CodeIdentifier.MakeValid(TypeName(type)), type.ToString(), kind, null, flags, null);
System\Xml\Serialization\XmlSchemaImporter.cs (4)
537
structMapping.TypeDesc = new
TypeDesc
(typeName, typeName, TypeKind.Struct, baseTypeDesc, flags);
592
structMapping.TypeDesc = new
TypeDesc
(typeName, typeName, TypeKind.Struct, baseTypeDesc, flags);
1705
enumMapping.TypeDesc = new
TypeDesc
(typeName, typeName, TypeKind.Enum, null, 0);
1761
enumMapping.TypeDesc = new
TypeDesc
(typeName, typeName, TypeKind.Enum, null, 0);
202 references to TypeDesc
System.Private.Xml (202)
System\Xml\Serialization\Mappings.cs (4)
286
private
TypeDesc
? _typeDesc;
317
internal
TypeDesc
? TypeDesc
685
private
TypeDesc
? _typeDesc;
725
internal
TypeDesc
? TypeDesc
System\Xml\Serialization\Models.cs (18)
46
TypeDesc
typeDesc = _typeScope.GetTypeDesc(type, null, directReference);
85
TypeDesc
typeDesc = _typeScope.GetArrayTypeDesc(type);
96
private readonly
TypeDesc
_typeDesc;
103
TypeDesc
typeDesc,
122
internal
TypeDesc
TypeDesc
131
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type,
TypeDesc
typeDesc, ModelScope scope) : base(type, typeDesc, scope) { }
143
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type,
TypeDesc
typeDesc, ModelScope scope) : base(type, typeDesc, scope) { }
150
TypeDesc
typeDesc, ModelScope scope) : base(type, typeDesc, scope) { }
157
TypeDesc
typeDesc, ModelScope scope) : base(type, typeDesc, scope) { }
203
private static void CheckSupportedMember(
TypeDesc
? typeDesc, MemberInfo member, Type type)
222
TypeDesc
typeDesc = ModelScope.TypeScope.GetTypeDesc(fieldInfo.FieldType, fieldInfo, true, false);
236
TypeDesc
typeDesc = ModelScope.TypeScope.GetTypeDesc(propertyInfo.PropertyType, propertyInfo, true, false);
277
private readonly
TypeDesc
_fieldTypeDesc;
279
internal FieldModel(string name, Type fieldType,
TypeDesc
fieldTypeDesc, bool checkSpecified, bool checkShouldPersist) :
283
internal FieldModel(string name, Type fieldType,
TypeDesc
fieldTypeDesc, bool checkSpecified, bool checkShouldPersist, bool readOnly)
294
internal FieldModel(MemberInfo memberInfo, Type fieldType,
TypeDesc
fieldTypeDesc)
350
internal
TypeDesc
FieldTypeDesc
422
Type type,
TypeDesc
typeDesc, ModelScope scope) : base(type, typeDesc, scope) { }
System\Xml\Serialization\ReflectionXmlSerializationReader.cs (7)
34
internal static
TypeDesc
StringTypeDesc { get; set; } = (new TypeScope()).GetTypeDesc(typeof(string));
35
internal static
TypeDesc
QnameTypeDesc { get; set; } = (new TypeScope()).GetTypeDesc(typeof(XmlQualifiedName));
775
TypeDesc
td = nullableMapping.BaseMapping!.TypeDesc!;
1105
TypeDesc
td = arrayMapping.TypeDesc!;
1366
TypeDesc
td = member.Mapping.TypeDesc!;
1466
TypeDesc
typeDesc = member.Mapping.TypeDesc!;
1475
private object? WriteAddCollectionFixup(Func<object?> getSource, Action<object?> setSource, object memberValue,
TypeDesc
typeDesc, bool readOnly)
System\Xml\Serialization\ReflectionXmlSerializationWriter.cs (9)
119
private void WriteMember(object? o, object? choiceSource, ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice,
TypeDesc
memberTypeDesc, bool writeAccessors)
133
private void WriteArray(object o, object? choiceSource, ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice,
TypeDesc
arrayTypeDesc)
233
TypeDesc
td = element.IsUnbounded ? element.Mapping!.TypeDesc!.CreateArrayTypeDesc() : element.Mapping!.TypeDesc!;
775
private void WriteMember(object? memberValue, AttributeAccessor attribute,
TypeDesc
memberTypeDesc, object? container)
781
TypeDesc
? arrayElementTypeDesc = memberTypeDesc.ArrayElementTypeDesc;
877
private static bool CanOptimizeWriteListSequence(
TypeDesc
? listElementTypeDesc)
942
TypeDesc
typeDesc = mapping.TypeDesc!;
1079
private bool WritePrimitiveValue(
TypeDesc
typeDesc, object? o, out string? stringValue)
1167
private static string ConvertPrimitiveToString(object o,
TypeDesc
typeDesc)
System\Xml\Serialization\SchemaImporter.cs (3)
81
TypeDesc
baseTypeDesc;
87
TypeDesc
typeDescToChange = structMapping.TypeDesc!;
111
TypeDesc
typeDesc = Scope.GetTypeDesc(typeof(object));
System\Xml\Serialization\SoapReflectionImporter.cs (8)
171
TypeDesc
? td = TypeScope.GetTypeDesc(dataType!, XmlSchema.Namespace);
202
TypeDesc
? baseTypeDesc = model.TypeDesc.BaseTypeDesc;
207
TypeDesc
valueTypeDesc = string.IsNullOrEmpty(dataType) ? model.TypeDesc.BaseTypeDesc! : TypeScope.GetTypeDesc(dataType, XmlSchema.Namespace)!;
226
TypeDesc
typeDesc = _typeScope.GetTypeDesc(typeof(object));
248
private TypeMapping? GetTypeMapping(string typeName, string? ns,
TypeDesc
typeDesc)
260
TypeDesc
typeDesc = baseMapping.TypeDesc!.GetNullableTypeDesc(type);
739
private object? GetDefaultValue(
TypeDesc
fieldTypeDesc, SoapAttributes a)
765
TypeDesc
typeDesc = _typeScope.GetTypeDesc(type);
System\Xml\Serialization\SourceInfo.cs (1)
52
public SourceInfo CastTo(
TypeDesc
td)
System\Xml\Serialization\Types.cs (41)
85
private
TypeDesc
? _arrayElementTypeDesc;
86
private
TypeDesc
? _arrayTypeDesc;
87
private
TypeDesc
? _nullableTypeDesc;
92
private
TypeDesc
? _baseTypeDesc;
100
internal TypeDesc(string name, string fullName, XmlSchemaType? dataType, TypeKind kind,
TypeDesc
? baseTypeDesc, TypeFlags flags, string? formatterName)
120
internal TypeDesc(string name, string fullName, TypeKind kind,
TypeDesc
? baseTypeDesc, TypeFlags flags)
126
: this(type!.Name, type.FullName!, dataType, TypeKind.Primitive, (
TypeDesc
?)null, flags, formatterName)
132
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? type, string name, string fullName, TypeKind kind,
TypeDesc
? baseTypeDesc, TypeFlags flags,
TypeDesc
? arrayElementTypeDesc)
360
internal
TypeDesc
GetNullableTypeDesc(
400
internal
TypeDesc
? ArrayElementTypeDesc
411
internal
TypeDesc
CreateArrayTypeDesc() => _arrayTypeDesc ??= new TypeDesc(null, $"{_name}[]", $"{_fullName}[]", TypeKind.Array, null, TypeFlags.Reference | (_flags & TypeFlags.UseReflection), this);
413
internal
TypeDesc
? BaseTypeDesc
423
internal bool IsDerivedFrom(
TypeDesc
baseTypeDesc)
425
TypeDesc
? typeDesc = this;
434
internal static
TypeDesc
? FindCommonBaseTypeDesc(
TypeDesc
[] typeDescs)
437
TypeDesc
? leastDerivedTypeDesc = null;
638
TypeDesc
typeDesc = new TypeDesc(type, true, dataType, formatterName, flags);
658
TypeDesc
typeDesc = new TypeDesc(type, false, dataType, formatterName, flags);
672
internal static
TypeDesc
? GetTypeDesc(string name, string ns)
677
internal static
TypeDesc
? GetTypeDesc(string name, string? ns, TypeFlags flags)
679
TypeDesc
? typeDesc = (
TypeDesc
?)s_primitiveNames[name, ns];
690
internal static
TypeDesc
? GetTypeDesc(XmlSchemaSimpleType dataType)
692
return (
TypeDesc
?)s_primitiveDataTypes[dataType];
696
internal
TypeDesc
GetTypeDesc(Type type)
702
internal
TypeDesc
GetTypeDesc(Type type, MemberInfo? source, bool directReference)
708
internal
TypeDesc
GetTypeDesc(Type type, MemberInfo? source, bool directReference, bool throwOnError)
715
TypeDesc
typeDesc =
716
(
TypeDesc
?)s_primitiveTypes[type] ??
717
(
TypeDesc
?)_typeDescs[type] ??
727
internal
TypeDesc
GetArrayTypeDesc(Type type)
729
TypeDesc
? typeDesc = (
TypeDesc
?)_arrayTypeDescs[type];
741
internal TypeMapping? GetTypeMappingFromTypeDesc(
TypeDesc
typeDesc)
751
internal Type? GetTypeFromTypeDesc(
TypeDesc
typeDesc)
764
private
TypeDesc
ImportTypeDesc(Type type, MemberInfo? memberInfo, bool directReference)
766
TypeDesc
? typeDesc;
939
TypeDesc
td = GetTypeDesc(arrayElementType, memberInfo, true, false);
1092
private static bool CanWriteProperty(PropertyInfo propertyInfo,
TypeDesc
typeDesc)
System\Xml\Serialization\XmlReflectionImporter.cs (23)
389
TypeDesc
modelTypeDesc = TypeScope.IsOptionalValue(model.Type) ? model.TypeDesc.BaseTypeDesc! : model.TypeDesc;
394
TypeDesc
? td = TypeScope.GetTypeDesc(dataType, XmlSchema.Namespace);
432
TypeDesc
valueTypeDesc = string.IsNullOrEmpty(dataType) ? model.TypeDesc.BaseTypeDesc! : TypeScope.GetTypeDesc(dataType, XmlSchema.Namespace)!;
494
private SpecialMapping ImportSpecialMapping(Type type,
TypeDesc
typeDesc, string? ns, ImportContext context)
612
private static InvalidOperationException UnsupportedException(
TypeDesc
typeDesc, ImportContext context)
620
TypeDesc
typeDesc = _typeScope.GetTypeDesc(typeof(object));
633
TypeDesc
typeDesc = baseMapping.TypeDesc!.GetNullableTypeDesc(type);
696
private TypeMapping? GetTypeMapping(string? typeName, string? ns,
TypeDesc
typeDesc, NameTable typeLib, Type? type)
942
TypeDesc
typeDesc = _typeScope.GetTypeDesc(type);
1121
private static void CheckContext(
TypeDesc
typeDesc, ImportContext context)
1309
TypeDesc
typeDesc = _typeScope.GetTypeDesc(xmlReflectionMember.MemberType!);
1490
TypeDesc
targetTypeDesc = _typeScope.GetTypeDesc(targetType);
1575
TypeDesc
targetTypeDesc = _typeScope.GetTypeDesc(targetType);
1605
TypeDesc
targetTypeDesc = _typeScope.GetTypeDesc(targetType);
1620
TypeDesc
targetTypeDesc = _typeScope.GetTypeDesc(targetType);
1680
TypeDesc
targetTypeDesc = _typeScope.GetTypeDesc(targetType);
1713
TypeDesc
arrayElementTypeDesc = _typeScope.GetTypeDesc(arrayElementType);
1862
TypeDesc
targetTypeDesc = _typeScope.GetTypeDesc(targetType);
1922
TypeDesc
targetTypeDesc = _typeScope.GetTypeDesc(targetType);
2120
private static object? GetDefaultValue(
TypeDesc
fieldTypeDesc, Type t, XmlAttributes a)
2154
private static XmlElementAttribute CreateElementAttribute(
TypeDesc
typeDesc)
2205
private static void CheckNullable(bool isNullable,
TypeDesc
typeDesc, TypeMapping? mapping)
2239
TypeDesc
typeDesc = new TypeScope().GetTypeDesc(type);
System\Xml\Serialization\XmlSchemaImporter.cs (12)
476
TypeDesc
? baseTypeDesc = null;
591
TypeDesc
baseTypeDesc = Scope.GetTypeDesc(baseType);
793
TypeDesc
[] typeDescs = new
TypeDesc
[uniqueTypeDescs.Count];
802
TypeDesc
.FindCommonBaseTypeDesc(typeDescs) ??
1514
TypeDesc
xmlnsTypeDesc = Scope.GetTypeDesc(typeof(System.Xml.Serialization.XmlSerializerNamespaces));
1698
TypeDesc
? sourceTypeDesc = TypeScope.GetTypeDesc((XmlSchemaSimpleType)sourceType);
1789
TypeDesc
sourceTypeDesc = GetDataTypeSource(dataType, flags);
1800
TypeDesc
? typeDesc;
1853
private
TypeDesc
GetDataTypeSource(XmlSchemaSimpleType dataType, TypeFlags flags)
1855
TypeDesc
? typeDesc;
1878
TypeDesc
? typeDesc = TypeScope.GetTypeDesc(name.Name, name.Namespace, flags);
System\Xml\Serialization\XmlSerializationGeneratedCode.cs (4)
27
private readonly
TypeDesc
? _stringTypeDesc;
28
private readonly
TypeDesc
? _qnameTypeDesc;
53
internal
TypeDesc
? StringTypeDesc { get { return _stringTypeDesc; } }
54
internal
TypeDesc
? QnameTypeDesc { get { return _qnameTypeDesc; } }
System\Xml\Serialization\XmlSerializationILGen.cs (4)
26
private readonly
TypeDesc
? _stringTypeDesc;
27
private readonly
TypeDesc
? _qnameTypeDesc;
54
internal
TypeDesc
? StringTypeDesc { get { return _stringTypeDesc; } }
55
internal
TypeDesc
? QnameTypeDesc { get { return _qnameTypeDesc; } }
System\Xml\Serialization\XmlSerializationReader.cs (19)
2045
private readonly
TypeDesc
_td;
2047
internal CreateCollectionInfo(string name,
TypeDesc
td)
2057
internal
TypeDesc
TypeDesc
2455
private string GetChoiceIdentifierSource(MemberMapping mapping, string parent,
TypeDesc
parentTypeDesc)
2739
private void WriteCreateCollection(
TypeDesc
td, string source)
3119
TypeDesc
td = arrayMapping.TypeDesc;
3509
TypeDesc
td = member.Mapping.TypeDesc!;
3548
private void WriteAddCollectionFixup(
TypeDesc
typeDesc, bool readOnly, string memberSource, string targetSource)
3604
TypeDesc
td = c.TypeDesc;
3897
TypeDesc
typeDesc = member.Mapping.TypeDesc!;
4237
TypeDesc
td = ((NullableMapping)e.Mapping).BaseMapping!.TypeDesc!;
4277
TypeDesc
td = ((NullableMapping)e.Mapping).BaseMapping!.TypeDesc!;
4366
private string GetArraySource(
TypeDesc
typeDesc, string arrayName)
4370
private string GetArraySource(
TypeDesc
typeDesc, string arrayName, bool multiRef)
4415
TypeDesc
typeDesc = member.Mapping.TypeDesc!;
4477
private void WriteSourceBeginTyped(string source,
TypeDesc
? typeDesc)
4524
TypeDesc
td = arrayMapping.TypeDesc!;
5089
private void WriteCatchCastException(
TypeDesc
typeDesc, string source, string? id)
5108
private void WriteArrayLocalDecl(string typeName, string variableName, string initValue,
TypeDesc
arrayTypeDesc)
System\Xml\Serialization\XmlSerializationReaderILGen.cs (6)
1264
TypeDesc
td = arrayMapping.TypeDesc;
2153
TypeDesc
typeDesc = member.Mapping.TypeDesc!;
2606
private static string GetArraySource(
TypeDesc
typeDesc, string arrayName)
2610
private static string GetArraySource(
TypeDesc
typeDesc, string arrayName, bool multiRef)
2653
TypeDesc
typeDesc = member.Mapping.TypeDesc!;
3513
private void WriteArrayLocalDecl(string typeName, string variableName, string initValue,
TypeDesc
arrayTypeDesc)
System\Xml\Serialization\XmlSerializationWriter.cs (24)
819
TypeDesc
typeDesc = new TypeScope().GetTypeDesc(type);
1610
TypeDesc
typeDesc = scope.GetTypeDesc(type);
1617
private string WriteTypeInfo(TypeScope scope,
TypeDesc
typeDesc, Type type)
1628
TypeDesc
elementTypeDesc = typeDesc.ArrayElementTypeDesc!;
1668
TypeDesc
elementTypeDesc = typeDesc.ArrayElementTypeDesc!;
1728
private void WriteCollectionInfo(string typeVariable,
TypeDesc
typeDesc,
1927
internal string GetStringForMember(string obj, string memberName,
TypeDesc
typeDesc)
1973
internal string GetStringForArrayMember(string arrayName, string subscript,
TypeDesc
arrayTypeDesc)
2087
internal void WriteArrayLocalDecl(string typeName, string variableName, string? initValue,
TypeDesc
arrayTypeDesc)
2415
private void WritePrimitiveValue(
TypeDesc
typeDesc, string source)
2446
TypeDesc
typeDesc = mapping.TypeDesc!;
3276
private bool CanOptimizeWriteListSequence(
TypeDesc
? listElementTypeDesc)
3286
private void WriteMember(string source, AttributeAccessor attribute,
TypeDesc
memberTypeDesc, string parent)
3326
TypeDesc
arrayElementTypeDesc = memberTypeDesc.ArrayElementTypeDesc!;
3475
TypeDesc
typeDesc = attribute.Mapping!.TypeDesc!;
3482
private void WriteMember(string source, string? choiceSource, ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice,
TypeDesc
memberTypeDesc, bool writeAccessors)
3492
private void WriteArray(string source, string? choiceSource, ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice,
TypeDesc
arrayTypeDesc)
3532
private void WriteArrayItems(ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice,
TypeDesc
arrayTypeDesc, string arrayName, string? choiceName)
3534
TypeDesc
arrayElementTypeDesc = arrayTypeDesc.ArrayElementTypeDesc!;
3645
TypeDesc
td = elements[0].IsUnbounded ? elements[0].Mapping!.TypeDesc!.CreateArrayTypeDesc() : elements[0].Mapping!.TypeDesc!;
3716
TypeDesc
td = element.IsUnbounded ? element.Mapping.TypeDesc.CreateArrayTypeDesc() : element.Mapping.TypeDesc;
3961
TypeDesc
td = arrayMapping.TypeDesc!.CreateArrayTypeDesc();
4228
private void WriteChoiceTypeCheck(string source, string fullTypeName, bool useReflection, ChoiceIdentifierAccessor choice, string enumName,
TypeDesc
typeDesc)
4421
private void WriteArrayLocalDecl(string typeName, string variableName, string? initValue,
TypeDesc
arrayTypeDesc)
System\Xml\Serialization\XmlSerializationWriterILGen.cs (15)
149
private void WritePrimitiveValue(
TypeDesc
typeDesc, SourceInfo source, out Type returnType)
200
TypeDesc
typeDesc = mapping.TypeDesc!;
1159
private bool CanOptimizeWriteListSequence(
TypeDesc
? listElementTypeDesc)
1169
private void WriteMember(SourceInfo source, AttributeAccessor attribute,
TypeDesc
memberTypeDesc, string parent)
1219
TypeDesc
arrayElementTypeDesc = memberTypeDesc.ArrayElementTypeDesc!;
1397
TypeDesc
typeDesc = attribute.Mapping!.TypeDesc!;
1423
private void WriteMember(SourceInfo source, string? choiceSource, ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice,
TypeDesc
memberTypeDesc, bool writeAccessors)
1434
private void WriteArray(SourceInfo source, string? choiceSource, ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice,
TypeDesc
arrayTypeDesc)
1496
private void WriteArrayItems(ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice,
TypeDesc
arrayTypeDesc, string arrayName, string? choiceName)
1498
TypeDesc
arrayElementTypeDesc = arrayTypeDesc.ArrayElementTypeDesc!;
1591
TypeDesc
td = elements[0].IsUnbounded ? elements[0].Mapping!.TypeDesc!.CreateArrayTypeDesc() : elements[0].Mapping!.TypeDesc!;
1660
TypeDesc
td = element.IsUnbounded ? element.Mapping!.TypeDesc!.CreateArrayTypeDesc() : element.Mapping!.TypeDesc!;
2178
private void WriteChoiceTypeCheck(SourceInfo source, ChoiceIdentifierAccessor choice, string enumName,
TypeDesc
typeDesc)
2251
private static void WriteArrayLocalDecl(string typeName, string variableName, SourceInfo initValue,
TypeDesc
arrayTypeDesc)
2578
internal static void WriteArrayLocalDecl(string typeName, string variableName, SourceInfo initValue,
TypeDesc
arrayTypeDesc)
System\Xml\Serialization\XmlSerializer.cs (4)
518
TypeDesc
typeDesc = (
TypeDesc
)TypeScope.PrimtiveTypes[_primitiveType]!;
813
TypeDesc
? typeDesc = (
TypeDesc
?)TypeScope.PrimtiveTypes[type];