9 instantiations of TypeDesc
System.Private.Xml (9)
System\Xml\Serialization\Types.cs (5)
364
_nullableTypeDesc = new
TypeDesc
($"NullableOf{_name}", $"System.Nullable`1[{_fullName}]", null, TypeKind.Struct, this, _flags | TypeFlags.OptionalValue, _formatterName);
407
internal TypeDesc CreateArrayTypeDesc() => _arrayTypeDesc ??= new
TypeDesc
(null, $"{_name}[]", $"{_fullName}[]", TypeKind.Array, null, TypeFlags.Reference | (_flags & TypeFlags.UseReflection), this);
632
TypeDesc typeDesc = new
TypeDesc
(type, true, dataType, formatterName, flags);
650
TypeDesc typeDesc = new
TypeDesc
(type, false, dataType, formatterName, flags);
914
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);
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)
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!;
1093
TypeDesc
td = arrayMapping.TypeDesc!;
1350
TypeDesc
td = member.Mapping.TypeDesc!;
1444
TypeDesc
typeDesc = member.Mapping.TypeDesc!;
1452
private object? WriteAddCollectionFixup(Func<object?> getSource, Action<object?> setSource, object memberValue,
TypeDesc
typeDesc, bool readOnly)
System\Xml\Serialization\ReflectionXmlSerializationWriter.cs (9)
116
private void WriteMember(object? o, object? choiceSource, ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice,
TypeDesc
memberTypeDesc, bool writeAccessors)
129
private void WriteArray(object o, object? choiceSource, ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice,
TypeDesc
arrayTypeDesc)
227
TypeDesc
td = element.IsUnbounded ? element.Mapping!.TypeDesc!.CreateArrayTypeDesc() : element.Mapping!.TypeDesc!;
762
private void WriteMember(object? memberValue, AttributeAccessor attribute,
TypeDesc
memberTypeDesc, object? container)
768
TypeDesc
? arrayElementTypeDesc = memberTypeDesc.ArrayElementTypeDesc;
864
private static bool CanOptimizeWriteListSequence(
TypeDesc
? listElementTypeDesc)
928
TypeDesc
typeDesc = mapping.TypeDesc!;
1065
private bool WritePrimitiveValue(
TypeDesc
typeDesc, object? o, out string? stringValue)
1153
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 (41)
85
private
TypeDesc
? _arrayElementTypeDesc;
86
private
TypeDesc
? _arrayTypeDesc;
87
private
TypeDesc
? _nullableTypeDesc;
91
private
TypeDesc
? _baseTypeDesc;
99
internal TypeDesc(string name, string fullName, XmlSchemaType? dataType, TypeKind kind,
TypeDesc
? baseTypeDesc, TypeFlags flags, string? formatterName)
119
internal TypeDesc(string name, string fullName, TypeKind kind,
TypeDesc
? baseTypeDesc, TypeFlags flags)
124
: this(type!.Name, type.FullName!, dataType, TypeKind.Primitive, (
TypeDesc
?)null, flags, formatterName)
129
internal TypeDesc(Type? type, string name, string fullName, TypeKind kind,
TypeDesc
? baseTypeDesc, TypeFlags flags,
TypeDesc
? arrayElementTypeDesc)
356
internal
TypeDesc
GetNullableTypeDesc(
396
internal
TypeDesc
? ArrayElementTypeDesc
407
internal
TypeDesc
CreateArrayTypeDesc() => _arrayTypeDesc ??= new TypeDesc(null, $"{_name}[]", $"{_fullName}[]", TypeKind.Array, null, TypeFlags.Reference | (_flags & TypeFlags.UseReflection), this);
409
internal
TypeDesc
? BaseTypeDesc
419
internal bool IsDerivedFrom(
TypeDesc
baseTypeDesc)
421
TypeDesc
? typeDesc = this;
430
internal static
TypeDesc
? FindCommonBaseTypeDesc(
TypeDesc
[] typeDescs)
433
TypeDesc
? leastDerivedTypeDesc = null;
632
TypeDesc
typeDesc = new TypeDesc(type, true, dataType, formatterName, flags);
650
TypeDesc
typeDesc = new TypeDesc(type, false, dataType, formatterName, flags);
662
internal static
TypeDesc
? GetTypeDesc(string name, string ns)
667
internal static
TypeDesc
? GetTypeDesc(string name, string? ns, TypeFlags flags)
669
TypeDesc
? typeDesc = (
TypeDesc
?)s_primitiveNames[name, ns];
680
internal static
TypeDesc
? GetTypeDesc(XmlSchemaSimpleType dataType)
682
return (
TypeDesc
?)s_primitiveDataTypes[dataType];
686
internal
TypeDesc
GetTypeDesc(Type type)
692
internal
TypeDesc
GetTypeDesc(Type type, MemberInfo? source, bool directReference)
698
internal
TypeDesc
GetTypeDesc(Type type, MemberInfo? source, bool directReference, bool throwOnError)
705
TypeDesc
typeDesc =
706
(
TypeDesc
?)s_primitiveTypes[type] ??
707
(
TypeDesc
?)_typeDescs[type] ??
717
internal
TypeDesc
GetArrayTypeDesc(Type type)
719
TypeDesc
? typeDesc = (
TypeDesc
?)_arrayTypeDescs[type];
731
internal TypeMapping? GetTypeMappingFromTypeDesc(
TypeDesc
typeDesc)
741
internal Type? GetTypeFromTypeDesc(
TypeDesc
typeDesc)
754
private
TypeDesc
ImportTypeDesc(Type type, MemberInfo? memberInfo, bool directReference)
756
TypeDesc
? typeDesc;
929
TypeDesc
td = GetTypeDesc(arrayElementType, memberInfo, true, false);
1083
private static bool CanWriteProperty(PropertyInfo propertyInfo,
TypeDesc
typeDesc)
System\Xml\Serialization\XmlReflectionImporter.cs (23)
404
TypeDesc
modelTypeDesc = TypeScope.IsOptionalValue(model.Type) ? model.TypeDesc.BaseTypeDesc! : model.TypeDesc;
409
TypeDesc
? td = TypeScope.GetTypeDesc(dataType, XmlSchema.Namespace);
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)
960
TypeDesc
typeDesc = _typeScope.GetTypeDesc(type);
1140
private static void CheckContext(
TypeDesc
typeDesc, ImportContext context)
1330
TypeDesc
typeDesc = _typeScope.GetTypeDesc(xmlReflectionMember.MemberType!);
1513
TypeDesc
targetTypeDesc = _typeScope.GetTypeDesc(targetType);
1599
TypeDesc
targetTypeDesc = _typeScope.GetTypeDesc(targetType);
1629
TypeDesc
targetTypeDesc = _typeScope.GetTypeDesc(targetType);
1644
TypeDesc
targetTypeDesc = _typeScope.GetTypeDesc(targetType);
1704
TypeDesc
targetTypeDesc = _typeScope.GetTypeDesc(targetType);
1737
TypeDesc
arrayElementTypeDesc = _typeScope.GetTypeDesc(arrayElementType);
1886
TypeDesc
targetTypeDesc = _typeScope.GetTypeDesc(targetType);
1946
TypeDesc
targetTypeDesc = _typeScope.GetTypeDesc(targetType);
2144
private static object? GetDefaultValue(
TypeDesc
fieldTypeDesc, Type t, XmlAttributes a)
2178
private static XmlElementAttribute CreateElementAttribute(
TypeDesc
typeDesc)
2229
private static void CheckNullable(bool isNullable,
TypeDesc
typeDesc, TypeMapping? mapping)
2263
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)
2056
private readonly
TypeDesc
_td;
2058
internal CreateCollectionInfo(string name,
TypeDesc
td)
2068
internal
TypeDesc
TypeDesc
2466
private string GetChoiceIdentifierSource(MemberMapping mapping, string parent,
TypeDesc
parentTypeDesc)
2750
private void WriteCreateCollection(
TypeDesc
td, string source)
3130
TypeDesc
td = arrayMapping.TypeDesc;
3520
TypeDesc
td = member.Mapping.TypeDesc!;
3559
private void WriteAddCollectionFixup(
TypeDesc
typeDesc, bool readOnly, string memberSource, string targetSource)
3615
TypeDesc
td = c.TypeDesc;
3908
TypeDesc
typeDesc = member.Mapping.TypeDesc!;
4248
TypeDesc
td = ((NullableMapping)e.Mapping).BaseMapping!.TypeDesc!;
4288
TypeDesc
td = ((NullableMapping)e.Mapping).BaseMapping!.TypeDesc!;
4377
private string GetArraySource(
TypeDesc
typeDesc, string arrayName)
4381
private string GetArraySource(
TypeDesc
typeDesc, string arrayName, bool multiRef)
4426
TypeDesc
typeDesc = member.Mapping.TypeDesc!;
4488
private void WriteSourceBeginTyped(string source,
TypeDesc
? typeDesc)
4535
TypeDesc
td = arrayMapping.TypeDesc!;
5100
private void WriteCatchCastException(
TypeDesc
typeDesc, string source, string? id)
5119
private void WriteArrayLocalDecl(string typeName, string variableName, string initValue,
TypeDesc
arrayTypeDesc)
System\Xml\Serialization\XmlSerializationReaderILGen.cs (6)
1252
TypeDesc
td = arrayMapping.TypeDesc;
2132
TypeDesc
typeDesc = member.Mapping.TypeDesc!;
2580
private static string GetArraySource(
TypeDesc
typeDesc, string arrayName)
2584
private static string GetArraySource(
TypeDesc
typeDesc, string arrayName, bool multiRef)
2625
TypeDesc
typeDesc = member.Mapping.TypeDesc!;
3478
private void WriteArrayLocalDecl(string typeName, string variableName, string initValue,
TypeDesc
arrayTypeDesc)
System\Xml\Serialization\XmlSerializationWriter.cs (24)
821
TypeDesc
typeDesc = new TypeScope().GetTypeDesc(type);
1612
TypeDesc
typeDesc = scope.GetTypeDesc(type);
1619
private string WriteTypeInfo(TypeScope scope,
TypeDesc
typeDesc, Type type)
1630
TypeDesc
elementTypeDesc = typeDesc.ArrayElementTypeDesc!;
1670
TypeDesc
elementTypeDesc = typeDesc.ArrayElementTypeDesc!;
1730
private void WriteCollectionInfo(string typeVariable,
TypeDesc
typeDesc,
1929
internal string GetStringForMember(string obj, string memberName,
TypeDesc
typeDesc)
1975
internal string GetStringForArrayMember(string arrayName, string subscript,
TypeDesc
arrayTypeDesc)
2089
internal void WriteArrayLocalDecl(string typeName, string variableName, string? initValue,
TypeDesc
arrayTypeDesc)
2417
private void WritePrimitiveValue(
TypeDesc
typeDesc, string source)
2448
TypeDesc
typeDesc = mapping.TypeDesc!;
3278
private bool CanOptimizeWriteListSequence(
TypeDesc
? listElementTypeDesc)
3288
private void WriteMember(string source, AttributeAccessor attribute,
TypeDesc
memberTypeDesc, string parent)
3328
TypeDesc
arrayElementTypeDesc = memberTypeDesc.ArrayElementTypeDesc!;
3477
TypeDesc
typeDesc = attribute.Mapping!.TypeDesc!;
3484
private void WriteMember(string source, string? choiceSource, ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice,
TypeDesc
memberTypeDesc, bool writeAccessors)
3494
private void WriteArray(string source, string? choiceSource, ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice,
TypeDesc
arrayTypeDesc)
3534
private void WriteArrayItems(ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice,
TypeDesc
arrayTypeDesc, string arrayName, string? choiceName)
3536
TypeDesc
arrayElementTypeDesc = arrayTypeDesc.ArrayElementTypeDesc!;
3647
TypeDesc
td = elements[0].IsUnbounded ? elements[0].Mapping!.TypeDesc!.CreateArrayTypeDesc() : elements[0].Mapping!.TypeDesc!;
3718
TypeDesc
td = element.IsUnbounded ? element.Mapping.TypeDesc.CreateArrayTypeDesc() : element.Mapping.TypeDesc;
3963
TypeDesc
td = arrayMapping.TypeDesc!.CreateArrayTypeDesc();
4230
private void WriteChoiceTypeCheck(string source, string fullTypeName, bool useReflection, ChoiceIdentifierAccessor choice, string enumName,
TypeDesc
typeDesc)
4423
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)
548
TypeDesc
typeDesc = (
TypeDesc
)TypeScope.PrimtiveTypes[_primitiveType]!;
847
TypeDesc
? typeDesc = (
TypeDesc
?)TypeScope.PrimtiveTypes[type];