9 instantiations of TypeDesc
System.Private.Xml (9)
System\Xml\Serialization\Types.cs (5)
365
_nullableTypeDesc = new
TypeDesc
($"NullableOf{_name}", $"System.Nullable`1[{_fullName}]", null, TypeKind.Struct, this, _flags | TypeFlags.OptionalValue, _formatterName);
408
internal TypeDesc CreateArrayTypeDesc() => _arrayTypeDesc ??= new
TypeDesc
(null, $"{_name}[]", $"{_fullName}[]", TypeKind.Array, null, TypeFlags.Reference | (_flags & TypeFlags.UseReflection), this);
646
TypeDesc typeDesc = new
TypeDesc
(type, true, dataType, formatterName, flags);
686
TypeDesc typeDesc = new
TypeDesc
(type, false, dataType, formatterName, flags);
977
typeDesc = new
TypeDesc
(type, CodeIdentifier.MakeValid(TypeName(type)), type.ToString(), kind, null, flags, null);
System\Xml\Serialization\XmlSchemaImporter.cs (4)
558
structMapping.TypeDesc = new
TypeDesc
(typeName, typeName, TypeKind.Struct, baseTypeDesc, flags);
614
structMapping.TypeDesc = new
TypeDesc
(typeName, typeName, TypeKind.Struct, baseTypeDesc, flags);
1744
enumMapping.TypeDesc = new
TypeDesc
(typeName, typeName, TypeKind.Enum, null, 0);
1801
enumMapping.TypeDesc = new
TypeDesc
(typeName, typeName, TypeKind.Enum, null, 0);
210 references to TypeDesc
System.Private.Xml (210)
System\Xml\Serialization\Mappings.cs (4)
286
private
TypeDesc
? _typeDesc;
317
internal
TypeDesc
? TypeDesc
684
private
TypeDesc
? _typeDesc;
724
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)
24
internal static
TypeDesc
StringTypeDesc { get; set; } = (new TypeScope()).GetTypeDesc(typeof(string));
25
internal static
TypeDesc
QnameTypeDesc { get; set; } = (new TypeScope()).GetTypeDesc(typeof(XmlQualifiedName));
769
TypeDesc
td = nullableMapping.BaseMapping!.TypeDesc!;
1103
TypeDesc
td = arrayMapping.TypeDesc!;
1360
TypeDesc
td = member.Mapping.TypeDesc!;
1454
TypeDesc
typeDesc = member.Mapping.TypeDesc!;
1462
private object? WriteAddCollectionFixup(Func<object?> getSource, Action<object?> setSource, object memberValue,
TypeDesc
typeDesc, bool readOnly)
System\Xml\Serialization\ReflectionXmlSerializationWriter.cs (10)
117
private void WriteMember(object? o, object? choiceSource, ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice,
TypeDesc
memberTypeDesc, bool writeAccessors)
130
private void WriteArray(object o, object? choiceSource, ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice,
TypeDesc
arrayTypeDesc)
226
TypeDesc
td = element.Mapping!.TypeDesc!;
250
TypeDesc
td = element.IsUnbounded ? element.Mapping!.TypeDesc!.CreateArrayTypeDesc() : element.Mapping!.TypeDesc!;
837
private void WriteMember(object? memberValue, AttributeAccessor attribute,
TypeDesc
memberTypeDesc, object? container)
843
TypeDesc
? arrayElementTypeDesc = memberTypeDesc.ArrayElementTypeDesc;
939
private static bool CanOptimizeWriteListSequence(
TypeDesc
? listElementTypeDesc)
1003
TypeDesc
typeDesc = mapping.TypeDesc!;
1140
private bool WritePrimitiveValue(
TypeDesc
typeDesc, object? o, out string? stringValue)
1238
private static string ConvertPrimitiveToString(object o,
TypeDesc
typeDesc)
System\Xml\Serialization\SchemaImporter.cs (3)
82
TypeDesc
baseTypeDesc;
88
TypeDesc
typeDescToChange = structMapping.TypeDesc!;
112
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)
50
public SourceInfo CastTo(
TypeDesc
td)
System\Xml\Serialization\Types.cs (47)
86
private
TypeDesc
? _arrayElementTypeDesc;
87
private
TypeDesc
? _arrayTypeDesc;
88
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)
125
: this(type!.Name, type.FullName!, dataType, TypeKind.Primitive, (
TypeDesc
?)null, flags, formatterName)
130
internal TypeDesc(Type? type, string name, string fullName, TypeKind kind,
TypeDesc
? baseTypeDesc, TypeFlags flags,
TypeDesc
? arrayElementTypeDesc)
357
internal
TypeDesc
GetNullableTypeDesc(
397
internal
TypeDesc
? ArrayElementTypeDesc
408
internal
TypeDesc
CreateArrayTypeDesc() => _arrayTypeDesc ??= new TypeDesc(null, $"{_name}[]", $"{_fullName}[]", TypeKind.Array, null, TypeFlags.Reference | (_flags & TypeFlags.UseReflection), this);
410
internal
TypeDesc
? BaseTypeDesc
420
internal bool IsDerivedFrom(
TypeDesc
baseTypeDesc)
422
TypeDesc
? typeDesc = this;
431
internal static
TypeDesc
? FindCommonBaseTypeDesc(
TypeDesc
[] typeDescs)
434
TypeDesc
? leastDerivedTypeDesc = null;
646
TypeDesc
typeDesc = new TypeDesc(type, true, dataType, formatterName, flags);
655
var secondaryList = (List<
TypeDesc
>?)s_primitiveNamesSecondary[dataTypeName, XmlSchema.Namespace];
658
secondaryList = new List<
TypeDesc
>();
686
TypeDesc
typeDesc = new TypeDesc(type, false, dataType, formatterName, flags);
698
internal static
TypeDesc
? GetMatchingTypeDesc(string name, string ns, string fullName)
701
var
td = GetTypeDesc(name, ns);
708
var tdList = (List<
TypeDesc
>?)s_primitiveNamesSecondary[name, ns];
713
foreach (
var
typeDesc in tdList)
725
internal static
TypeDesc
? GetTypeDesc(string name, string ns)
730
internal static
TypeDesc
? GetTypeDesc(string name, string? ns, TypeFlags flags)
732
TypeDesc
? typeDesc = (
TypeDesc
?)s_primitiveNames[name, ns];
743
internal static
TypeDesc
? GetTypeDesc(XmlSchemaSimpleType dataType)
745
return (
TypeDesc
?)s_primitiveDataTypes[dataType];
749
internal
TypeDesc
GetTypeDesc(Type type)
755
internal
TypeDesc
GetTypeDesc(Type type, MemberInfo? source, bool directReference)
761
internal
TypeDesc
GetTypeDesc(Type type, MemberInfo? source, bool directReference, bool throwOnError)
768
TypeDesc
typeDesc =
769
(
TypeDesc
?)s_primitiveTypes[type] ??
770
(
TypeDesc
?)_typeDescs[type] ??
780
internal
TypeDesc
GetArrayTypeDesc(Type type)
782
TypeDesc
? typeDesc = (
TypeDesc
?)_arrayTypeDescs[type];
794
internal TypeMapping? GetTypeMappingFromTypeDesc(
TypeDesc
typeDesc)
804
internal Type? GetTypeFromTypeDesc(
TypeDesc
typeDesc)
817
private
TypeDesc
ImportTypeDesc(Type type, MemberInfo? memberInfo, bool directReference)
819
TypeDesc
? typeDesc;
992
TypeDesc
td = GetTypeDesc(arrayElementType, memberInfo, true, false);
1168
private static bool CanWriteProperty(PropertyInfo propertyInfo,
TypeDesc
typeDesc)
System\Xml\Serialization\XmlReflectionImporter.cs (24)
404
TypeDesc
modelTypeDesc = TypeScope.IsOptionalValue(model.Type) ? model.TypeDesc.BaseTypeDesc! : model.TypeDesc;
409
TypeDesc
? td = TypeScope.GetMatchingTypeDesc(dataType, XmlSchema.Namespace, modelTypeDesc.FullName);
447
TypeDesc
valueTypeDesc = string.IsNullOrEmpty(dataType) ? model.TypeDesc.BaseTypeDesc! : TypeScope.GetTypeDesc(dataType, XmlSchema.Namespace)!;
510
private SpecialMapping ImportSpecialMapping(Type type,
TypeDesc
typeDesc, string? ns, ImportContext context)
628
private static InvalidOperationException UnsupportedException(
TypeDesc
typeDesc, ImportContext context)
636
TypeDesc
typeDesc = _typeScope.GetTypeDesc(typeof(object));
649
TypeDesc
typeDesc = baseMapping.TypeDesc!.GetNullableTypeDesc(type);
712
private TypeMapping? GetTypeMapping(string? typeName, string? ns,
TypeDesc
typeDesc, NameTable typeLib, Type? type)
964
TypeDesc
typeDesc = _typeScope.GetTypeDesc(type);
1144
private static void CheckContext(
TypeDesc
typeDesc, ImportContext context)
1169
TypeDesc
modelTypeDesc = TypeScope.IsOptionalValue(model.Type) ? model.TypeDesc.BaseTypeDesc! : model.TypeDesc;
1335
TypeDesc
typeDesc = _typeScope.GetTypeDesc(xmlReflectionMember.MemberType!);
1518
TypeDesc
targetTypeDesc = _typeScope.GetTypeDesc(targetType);
1604
TypeDesc
targetTypeDesc = _typeScope.GetTypeDesc(targetType);
1634
TypeDesc
targetTypeDesc = _typeScope.GetTypeDesc(targetType);
1649
TypeDesc
targetTypeDesc = _typeScope.GetTypeDesc(targetType);
1709
TypeDesc
targetTypeDesc = _typeScope.GetTypeDesc(targetType);
1742
TypeDesc
arrayElementTypeDesc = _typeScope.GetTypeDesc(arrayElementType);
1891
TypeDesc
targetTypeDesc = _typeScope.GetTypeDesc(targetType);
1951
TypeDesc
targetTypeDesc = _typeScope.GetTypeDesc(targetType);
2149
private static object? GetDefaultValue(
TypeDesc
fieldTypeDesc, Type t, XmlAttributes a)
2183
private static XmlElementAttribute CreateElementAttribute(
TypeDesc
typeDesc)
2264
private static void CheckNullable(bool isNullable,
TypeDesc
typeDesc, TypeMapping? mapping)
2298
TypeDesc
typeDesc = new TypeScope().GetTypeDesc(type);
System\Xml\Serialization\XmlSchemaImporter.cs (12)
497
TypeDesc
? baseTypeDesc = null;
613
TypeDesc
baseTypeDesc = Scope.GetTypeDesc(baseType);
818
TypeDesc
[] typeDescs = new
TypeDesc
[uniqueTypeDescs.Count];
827
TypeDesc
.FindCommonBaseTypeDesc(typeDescs) ??
1549
TypeDesc
xmlnsTypeDesc = Scope.GetTypeDesc(typeof(System.Xml.Serialization.XmlSerializerNamespaces));
1737
TypeDesc
? sourceTypeDesc = TypeScope.GetTypeDesc((XmlSchemaSimpleType)sourceType);
1829
TypeDesc
sourceTypeDesc = GetDataTypeSource(dataType, flags);
1840
TypeDesc
? typeDesc;
1893
private
TypeDesc
GetDataTypeSource(XmlSchemaSimpleType dataType, TypeFlags flags)
1895
TypeDesc
? typeDesc;
1918
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)
28
private readonly
TypeDesc
? _stringTypeDesc;
29
private readonly
TypeDesc
? _qnameTypeDesc;
55
internal
TypeDesc
? StringTypeDesc { get { return _stringTypeDesc; } }
56
internal
TypeDesc
? QnameTypeDesc { get { return _qnameTypeDesc; } }
System\Xml\Serialization\XmlSerializationReader.cs (19)
2082
private readonly
TypeDesc
_td;
2084
internal CreateCollectionInfo(string name,
TypeDesc
td)
2094
internal
TypeDesc
TypeDesc
2492
private string GetChoiceIdentifierSource(MemberMapping mapping, string parent,
TypeDesc
parentTypeDesc)
2776
private void WriteCreateCollection(
TypeDesc
td, string source)
3156
TypeDesc
td = arrayMapping.TypeDesc;
3546
TypeDesc
td = member.Mapping.TypeDesc!;
3585
private void WriteAddCollectionFixup(
TypeDesc
typeDesc, bool readOnly, string memberSource, string targetSource)
3641
TypeDesc
td = c.TypeDesc;
3934
TypeDesc
typeDesc = member.Mapping.TypeDesc!;
4274
TypeDesc
td = ((NullableMapping)e.Mapping).BaseMapping!.TypeDesc!;
4314
TypeDesc
td = ((NullableMapping)e.Mapping).BaseMapping!.TypeDesc!;
4403
private string GetArraySource(
TypeDesc
typeDesc, string arrayName)
4407
private string GetArraySource(
TypeDesc
typeDesc, string arrayName, bool multiRef)
4452
TypeDesc
typeDesc = member.Mapping.TypeDesc!;
4514
private void WriteSourceBeginTyped(string source,
TypeDesc
? typeDesc)
4561
TypeDesc
td = arrayMapping.TypeDesc!;
5135
private void WriteCatchCastException(
TypeDesc
typeDesc, string source, string? id)
5154
private void WriteArrayLocalDecl(string typeName, string variableName, string initValue,
TypeDesc
arrayTypeDesc)
System\Xml\Serialization\XmlSerializationReaderILGen.cs (6)
1251
TypeDesc
td = arrayMapping.TypeDesc;
2131
TypeDesc
typeDesc = member.Mapping.TypeDesc!;
2579
private static string GetArraySource(
TypeDesc
typeDesc, string arrayName)
2583
private static string GetArraySource(
TypeDesc
typeDesc, string arrayName, bool multiRef)
2624
TypeDesc
typeDesc = member.Mapping.TypeDesc!;
3478
private void WriteArrayLocalDecl(string typeName, string variableName, string initValue,
TypeDesc
arrayTypeDesc)
System\Xml\Serialization\XmlSerializationWriter.cs (24)
868
TypeDesc
typeDesc = new TypeScope().GetTypeDesc(type);
1659
TypeDesc
typeDesc = scope.GetTypeDesc(type);
1666
private string WriteTypeInfo(TypeScope scope,
TypeDesc
typeDesc, Type type)
1677
TypeDesc
elementTypeDesc = typeDesc.ArrayElementTypeDesc!;
1717
TypeDesc
elementTypeDesc = typeDesc.ArrayElementTypeDesc!;
1777
private void WriteCollectionInfo(string typeVariable,
TypeDesc
typeDesc,
1976
internal string GetStringForMember(string obj, string memberName,
TypeDesc
typeDesc)
2022
internal string GetStringForArrayMember(string arrayName, string subscript,
TypeDesc
arrayTypeDesc)
2136
internal void WriteArrayLocalDecl(string typeName, string variableName, string? initValue,
TypeDesc
arrayTypeDesc)
2464
private void WritePrimitiveValue(
TypeDesc
typeDesc, string source)
2495
TypeDesc
typeDesc = mapping.TypeDesc!;
3325
private bool CanOptimizeWriteListSequence(
TypeDesc
? listElementTypeDesc)
3335
private void WriteMember(string source, AttributeAccessor attribute,
TypeDesc
memberTypeDesc, string parent)
3375
TypeDesc
arrayElementTypeDesc = memberTypeDesc.ArrayElementTypeDesc!;
3524
TypeDesc
typeDesc = attribute.Mapping!.TypeDesc!;
3531
private void WriteMember(string source, string? choiceSource, ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice,
TypeDesc
memberTypeDesc, bool writeAccessors)
3541
private void WriteArray(string source, string? choiceSource, ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice,
TypeDesc
arrayTypeDesc)
3581
private void WriteArrayItems(ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice,
TypeDesc
arrayTypeDesc, string arrayName, string? choiceName)
3583
TypeDesc
arrayElementTypeDesc = arrayTypeDesc.ArrayElementTypeDesc!;
3694
TypeDesc
td = elements[0].IsUnbounded ? elements[0].Mapping!.TypeDesc!.CreateArrayTypeDesc() : elements[0].Mapping!.TypeDesc!;
3765
TypeDesc
td = element.IsUnbounded ? element.Mapping.TypeDesc.CreateArrayTypeDesc() : element.Mapping.TypeDesc;
4010
TypeDesc
td = arrayMapping.TypeDesc!.CreateArrayTypeDesc();
4277
private void WriteChoiceTypeCheck(string source, string fullTypeName, bool useReflection, ChoiceIdentifierAccessor choice, string enumName,
TypeDesc
typeDesc)
4490
private void WriteArrayLocalDecl(string typeName, string variableName, string? initValue,
TypeDesc
arrayTypeDesc)
System\Xml\Serialization\XmlSerializationWriterILGen.cs (15)
143
private void WritePrimitiveValue(
TypeDesc
typeDesc, SourceInfo source, out Type returnType)
193
TypeDesc
typeDesc = mapping.TypeDesc!;
1143
private bool CanOptimizeWriteListSequence(
TypeDesc
? listElementTypeDesc)
1152
private void WriteMember(SourceInfo source, AttributeAccessor attribute,
TypeDesc
memberTypeDesc, string parent)
1202
TypeDesc
arrayElementTypeDesc = memberTypeDesc.ArrayElementTypeDesc!;
1379
TypeDesc
typeDesc = attribute.Mapping!.TypeDesc!;
1404
private void WriteMember(SourceInfo source, string? choiceSource, ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice,
TypeDesc
memberTypeDesc, bool writeAccessors)
1414
private void WriteArray(SourceInfo source, string? choiceSource, ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice,
TypeDesc
arrayTypeDesc)
1475
private void WriteArrayItems(ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice,
TypeDesc
arrayTypeDesc, string arrayName, string? choiceName)
1477
TypeDesc
arrayElementTypeDesc = arrayTypeDesc.ArrayElementTypeDesc!;
1569
TypeDesc
td = elements[0].IsUnbounded ? elements[0].Mapping!.TypeDesc!.CreateArrayTypeDesc() : elements[0].Mapping!.TypeDesc!;
1638
TypeDesc
td = element.IsUnbounded ? element.Mapping!.TypeDesc!.CreateArrayTypeDesc() : element.Mapping!.TypeDesc!;
2151
private void WriteChoiceTypeCheck(SourceInfo source, ChoiceIdentifierAccessor choice, string enumName,
TypeDesc
typeDesc)
2220
private static void WriteArrayLocalDecl(string typeName, string variableName, SourceInfo initValue,
TypeDesc
arrayTypeDesc)
2547
internal static void WriteArrayLocalDecl(string typeName, string variableName, SourceInfo initValue,
TypeDesc
arrayTypeDesc)
System\Xml\Serialization\XmlSerializer.cs (4)
547
TypeDesc
typeDesc = (
TypeDesc
)TypeScope.PrimtiveTypes[_primitiveType]!;
846
TypeDesc
? typeDesc = (
TypeDesc
?)TypeScope.PrimtiveTypes[type];