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)
301
private
TypeDesc
? _typeDesc;
332
internal
TypeDesc
? TypeDesc
699
private
TypeDesc
? _typeDesc;
739
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)
31
internal static
TypeDesc
StringTypeDesc { get; set; } = (new TypeScope()).GetTypeDesc(typeof(string));
32
internal static
TypeDesc
QnameTypeDesc { get; set; } = (new TypeScope()).GetTypeDesc(typeof(XmlQualifiedName));
806
TypeDesc
td = nullableMapping.BaseMapping!.TypeDesc!;
1197
TypeDesc
td = arrayMapping.TypeDesc!;
1452
TypeDesc
td = member.Mapping.TypeDesc!;
1546
TypeDesc
typeDesc = member.Mapping.TypeDesc!;
1554
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)
245
TypeDesc
td = element.Mapping!.TypeDesc!;
269
TypeDesc
td = element.IsUnbounded ? element.Mapping!.TypeDesc!.CreateArrayTypeDesc() : element.Mapping!.TypeDesc!;
852
private void WriteMember(object? memberValue, AttributeAccessor attribute,
TypeDesc
memberTypeDesc, object? container)
858
TypeDesc
? arrayElementTypeDesc = memberTypeDesc.ArrayElementTypeDesc;
954
private static bool CanOptimizeWriteListSequence(
TypeDesc
? listElementTypeDesc)
1018
TypeDesc
typeDesc = mapping.TypeDesc!;
1155
private bool WritePrimitiveValue(
TypeDesc
typeDesc, object? o, out string? stringValue)
1253
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)
965
TypeDesc
typeDesc = _typeScope.GetTypeDesc(type);
1145
private static void CheckContext(
TypeDesc
typeDesc, ImportContext context)
1170
TypeDesc
modelTypeDesc = TypeScope.IsOptionalValue(model.Type) ? model.TypeDesc.BaseTypeDesc! : model.TypeDesc;
1336
TypeDesc
typeDesc = _typeScope.GetTypeDesc(xmlReflectionMember.MemberType!);
1519
TypeDesc
targetTypeDesc = _typeScope.GetTypeDesc(targetType);
1605
TypeDesc
targetTypeDesc = _typeScope.GetTypeDesc(targetType);
1635
TypeDesc
targetTypeDesc = _typeScope.GetTypeDesc(targetType);
1664
TypeDesc
targetTypeDesc = _typeScope.GetTypeDesc(targetType);
1724
TypeDesc
targetTypeDesc = _typeScope.GetTypeDesc(targetType);
1757
TypeDesc
arrayElementTypeDesc = _typeScope.GetTypeDesc(arrayElementType);
1906
TypeDesc
targetTypeDesc = _typeScope.GetTypeDesc(targetType);
1966
TypeDesc
targetTypeDesc = _typeScope.GetTypeDesc(targetType);
2164
private static object? GetDefaultValue(
TypeDesc
fieldTypeDesc, Type t, XmlAttributes a)
2198
private static XmlElementAttribute CreateElementAttribute(
TypeDesc
typeDesc)
2279
private static void CheckNullable(bool isNullable,
TypeDesc
typeDesc, TypeMapping? mapping)
2313
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)
2104
private readonly
TypeDesc
_td;
2106
internal CreateCollectionInfo(string name,
TypeDesc
td)
2116
internal
TypeDesc
TypeDesc
2527
private string GetChoiceIdentifierSource(MemberMapping mapping, string parent,
TypeDesc
parentTypeDesc)
2811
private void WriteCreateCollection(
TypeDesc
td, string source)
3191
TypeDesc
td = arrayMapping.TypeDesc;
3581
TypeDesc
td = member.Mapping.TypeDesc!;
3620
private void WriteAddCollectionFixup(
TypeDesc
typeDesc, bool readOnly, string memberSource, string targetSource)
3676
TypeDesc
td = c.TypeDesc;
3976
TypeDesc
typeDesc = member.Mapping.TypeDesc!;
4340
TypeDesc
td = ((NullableMapping)e.Mapping).BaseMapping!.TypeDesc!;
4380
TypeDesc
td = ((NullableMapping)e.Mapping).BaseMapping!.TypeDesc!;
4469
private string GetArraySource(
TypeDesc
typeDesc, string arrayName)
4473
private string GetArraySource(
TypeDesc
typeDesc, string arrayName, bool multiRef)
4518
TypeDesc
typeDesc = member.Mapping.TypeDesc!;
4580
private void WriteSourceBeginTyped(string source,
TypeDesc
? typeDesc)
4653
TypeDesc
td = arrayMapping.TypeDesc!;
5229
private void WriteCatchCastException(
TypeDesc
typeDesc, string source, string? id)
5248
private void WriteArrayLocalDecl(string typeName, string variableName, string initValue,
TypeDesc
arrayTypeDesc)
System\Xml\Serialization\XmlSerializationReaderILGen.cs (6)
1328
TypeDesc
td = arrayMapping.TypeDesc;
2209
TypeDesc
typeDesc = member.Mapping.TypeDesc!;
2696
private static string GetArraySource(
TypeDesc
typeDesc, string arrayName)
2700
private static string GetArraySource(
TypeDesc
typeDesc, string arrayName, bool multiRef)
2741
TypeDesc
typeDesc = member.Mapping.TypeDesc!;
3695
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!;
3712
TypeDesc
td = elements[0].IsUnbounded ? elements[0].Mapping!.TypeDesc!.CreateArrayTypeDesc() : elements[0].Mapping!.TypeDesc!;
3783
TypeDesc
td = element.IsUnbounded ? element.Mapping.TypeDesc.CreateArrayTypeDesc() : element.Mapping.TypeDesc;
4028
TypeDesc
td = arrayMapping.TypeDesc!.CreateArrayTypeDesc();
4295
private void WriteChoiceTypeCheck(string source, string fullTypeName, bool useReflection, ChoiceIdentifierAccessor choice, string enumName,
TypeDesc
typeDesc)
4508
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!;
1612
TypeDesc
td = elements[0].IsUnbounded ? elements[0].Mapping!.TypeDesc!.CreateArrayTypeDesc() : elements[0].Mapping!.TypeDesc!;
1681
TypeDesc
td = element.IsUnbounded ? element.Mapping!.TypeDesc!.CreateArrayTypeDesc() : element.Mapping!.TypeDesc!;
2194
private void WriteChoiceTypeCheck(SourceInfo source, ChoiceIdentifierAccessor choice, string enumName,
TypeDesc
typeDesc)
2263
private static void WriteArrayLocalDecl(string typeName, string variableName, SourceInfo initValue,
TypeDesc
arrayTypeDesc)
2590
internal static void WriteArrayLocalDecl(string typeName, string variableName, SourceInfo initValue,
TypeDesc
arrayTypeDesc)
System\Xml\Serialization\XmlSerializer.cs (4)
551
TypeDesc
typeDesc = (
TypeDesc
)TypeScope.PrimtiveTypes[_primitiveType]!;
860
TypeDesc
? typeDesc = (
TypeDesc
?)TypeScope.PrimtiveTypes[type];