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); 407internal TypeDesc CreateArrayTypeDesc() => _arrayTypeDesc ??= new TypeDesc(null, $"{_name}[]", $"{_fullName}[]", TypeKind.Array, null, TypeFlags.Reference | (_flags & TypeFlags.UseReflection), this); 632TypeDesc typeDesc = new TypeDesc(type, true, dataType, formatterName, flags); 650TypeDesc typeDesc = new TypeDesc(type, false, dataType, formatterName, flags); 914typeDesc = new TypeDesc(type, CodeIdentifier.MakeValid(TypeName(type)), type.ToString(), kind, null, flags, null);
System\Xml\Serialization\XmlSchemaImporter.cs (4)
558structMapping.TypeDesc = new TypeDesc(typeName, typeName, TypeKind.Struct, baseTypeDesc, flags); 614structMapping.TypeDesc = new TypeDesc(typeName, typeName, TypeKind.Struct, baseTypeDesc, flags); 1744enumMapping.TypeDesc = new TypeDesc(typeName, typeName, TypeKind.Enum, null, 0); 1801enumMapping.TypeDesc = new TypeDesc(typeName, typeName, TypeKind.Enum, null, 0);
202 references to TypeDesc
System.Private.Xml (202)
System\Xml\Serialization\Mappings.cs (4)
286private TypeDesc? _typeDesc; 317internal TypeDesc? TypeDesc 685private TypeDesc? _typeDesc; 725internal TypeDesc? TypeDesc
System\Xml\Serialization\Models.cs (18)
46TypeDesc typeDesc = _typeScope.GetTypeDesc(type, null, directReference); 85TypeDesc typeDesc = _typeScope.GetArrayTypeDesc(type); 96private readonly TypeDesc _typeDesc; 103TypeDesc typeDesc, 122internal 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) { } 150TypeDesc typeDesc, ModelScope scope) : base(type, typeDesc, scope) { } 157TypeDesc typeDesc, ModelScope scope) : base(type, typeDesc, scope) { } 203private static void CheckSupportedMember(TypeDesc? typeDesc, MemberInfo member, Type type) 222TypeDesc typeDesc = ModelScope.TypeScope.GetTypeDesc(fieldInfo.FieldType, fieldInfo, true, false); 236TypeDesc typeDesc = ModelScope.TypeScope.GetTypeDesc(propertyInfo.PropertyType, propertyInfo, true, false); 277private readonly TypeDesc _fieldTypeDesc; 279internal FieldModel(string name, Type fieldType, TypeDesc fieldTypeDesc, bool checkSpecified, bool checkShouldPersist) : 283internal FieldModel(string name, Type fieldType, TypeDesc fieldTypeDesc, bool checkSpecified, bool checkShouldPersist, bool readOnly) 294internal FieldModel(MemberInfo memberInfo, Type fieldType, TypeDesc fieldTypeDesc) 350internal TypeDesc FieldTypeDesc 422Type type, TypeDesc typeDesc, ModelScope scope) : base(type, typeDesc, scope) { }
System\Xml\Serialization\ReflectionXmlSerializationReader.cs (7)
24internal static TypeDesc StringTypeDesc { get; set; } = (new TypeScope()).GetTypeDesc(typeof(string)); 25internal static TypeDesc QnameTypeDesc { get; set; } = (new TypeScope()).GetTypeDesc(typeof(XmlQualifiedName)); 769TypeDesc td = nullableMapping.BaseMapping!.TypeDesc!; 1093TypeDesc td = arrayMapping.TypeDesc!; 1350TypeDesc td = member.Mapping.TypeDesc!; 1444TypeDesc typeDesc = member.Mapping.TypeDesc!; 1452private object? WriteAddCollectionFixup(Func<object?> getSource, Action<object?> setSource, object memberValue, TypeDesc typeDesc, bool readOnly)
System\Xml\Serialization\ReflectionXmlSerializationWriter.cs (9)
116private void WriteMember(object? o, object? choiceSource, ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice, TypeDesc memberTypeDesc, bool writeAccessors) 129private void WriteArray(object o, object? choiceSource, ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice, TypeDesc arrayTypeDesc) 227TypeDesc td = element.IsUnbounded ? element.Mapping!.TypeDesc!.CreateArrayTypeDesc() : element.Mapping!.TypeDesc!; 762private void WriteMember(object? memberValue, AttributeAccessor attribute, TypeDesc memberTypeDesc, object? container) 768TypeDesc? arrayElementTypeDesc = memberTypeDesc.ArrayElementTypeDesc; 864private static bool CanOptimizeWriteListSequence(TypeDesc? listElementTypeDesc) 928TypeDesc typeDesc = mapping.TypeDesc!; 1065private bool WritePrimitiveValue(TypeDesc typeDesc, object? o, out string? stringValue) 1153private static string ConvertPrimitiveToString(object o, TypeDesc typeDesc)
System\Xml\Serialization\SchemaImporter.cs (3)
82TypeDesc baseTypeDesc; 88TypeDesc typeDescToChange = structMapping.TypeDesc!; 112TypeDesc typeDesc = Scope.GetTypeDesc(typeof(object));
System\Xml\Serialization\SoapReflectionImporter.cs (8)
171TypeDesc? td = TypeScope.GetTypeDesc(dataType!, XmlSchema.Namespace); 202TypeDesc? baseTypeDesc = model.TypeDesc.BaseTypeDesc; 207TypeDesc valueTypeDesc = string.IsNullOrEmpty(dataType) ? model.TypeDesc.BaseTypeDesc! : TypeScope.GetTypeDesc(dataType, XmlSchema.Namespace)!; 226TypeDesc typeDesc = _typeScope.GetTypeDesc(typeof(object)); 248private TypeMapping? GetTypeMapping(string typeName, string? ns, TypeDesc typeDesc) 260TypeDesc typeDesc = baseMapping.TypeDesc!.GetNullableTypeDesc(type); 739private object? GetDefaultValue(TypeDesc fieldTypeDesc, SoapAttributes a) 765TypeDesc typeDesc = _typeScope.GetTypeDesc(type);
System\Xml\Serialization\SourceInfo.cs (1)
50public SourceInfo CastTo(TypeDesc td)
System\Xml\Serialization\Types.cs (41)
85private TypeDesc? _arrayElementTypeDesc; 86private TypeDesc? _arrayTypeDesc; 87private TypeDesc? _nullableTypeDesc; 91private TypeDesc? _baseTypeDesc; 99internal TypeDesc(string name, string fullName, XmlSchemaType? dataType, TypeKind kind, TypeDesc? baseTypeDesc, TypeFlags flags, string? formatterName) 119internal TypeDesc(string name, string fullName, TypeKind kind, TypeDesc? baseTypeDesc, TypeFlags flags) 124: this(type!.Name, type.FullName!, dataType, TypeKind.Primitive, (TypeDesc?)null, flags, formatterName) 129internal TypeDesc(Type? type, string name, string fullName, TypeKind kind, TypeDesc? baseTypeDesc, TypeFlags flags, TypeDesc? arrayElementTypeDesc) 356internal TypeDesc GetNullableTypeDesc( 396internal TypeDesc? ArrayElementTypeDesc 407internal TypeDesc CreateArrayTypeDesc() => _arrayTypeDesc ??= new TypeDesc(null, $"{_name}[]", $"{_fullName}[]", TypeKind.Array, null, TypeFlags.Reference | (_flags & TypeFlags.UseReflection), this); 409internal TypeDesc? BaseTypeDesc 419internal bool IsDerivedFrom(TypeDesc baseTypeDesc) 421TypeDesc? typeDesc = this; 430internal static TypeDesc? FindCommonBaseTypeDesc(TypeDesc[] typeDescs) 433TypeDesc? leastDerivedTypeDesc = null; 632TypeDesc typeDesc = new TypeDesc(type, true, dataType, formatterName, flags); 650TypeDesc typeDesc = new TypeDesc(type, false, dataType, formatterName, flags); 662internal static TypeDesc? GetTypeDesc(string name, string ns) 667internal static TypeDesc? GetTypeDesc(string name, string? ns, TypeFlags flags) 669TypeDesc? typeDesc = (TypeDesc?)s_primitiveNames[name, ns]; 680internal static TypeDesc? GetTypeDesc(XmlSchemaSimpleType dataType) 682return (TypeDesc?)s_primitiveDataTypes[dataType]; 686internal TypeDesc GetTypeDesc(Type type) 692internal TypeDesc GetTypeDesc(Type type, MemberInfo? source, bool directReference) 698internal TypeDesc GetTypeDesc(Type type, MemberInfo? source, bool directReference, bool throwOnError) 705TypeDesc typeDesc = 706(TypeDesc?)s_primitiveTypes[type] ?? 707(TypeDesc?)_typeDescs[type] ?? 717internal TypeDesc GetArrayTypeDesc(Type type) 719TypeDesc? typeDesc = (TypeDesc?)_arrayTypeDescs[type]; 731internal TypeMapping? GetTypeMappingFromTypeDesc(TypeDesc typeDesc) 741internal Type? GetTypeFromTypeDesc(TypeDesc typeDesc) 754private TypeDesc ImportTypeDesc(Type type, MemberInfo? memberInfo, bool directReference) 756TypeDesc? typeDesc; 929TypeDesc td = GetTypeDesc(arrayElementType, memberInfo, true, false); 1083private static bool CanWriteProperty(PropertyInfo propertyInfo, TypeDesc typeDesc)
System\Xml\Serialization\XmlReflectionImporter.cs (23)
404TypeDesc modelTypeDesc = TypeScope.IsOptionalValue(model.Type) ? model.TypeDesc.BaseTypeDesc! : model.TypeDesc; 409TypeDesc? td = TypeScope.GetTypeDesc(dataType, XmlSchema.Namespace); 447TypeDesc valueTypeDesc = string.IsNullOrEmpty(dataType) ? model.TypeDesc.BaseTypeDesc! : TypeScope.GetTypeDesc(dataType, XmlSchema.Namespace)!; 510private SpecialMapping ImportSpecialMapping(Type type, TypeDesc typeDesc, string? ns, ImportContext context) 628private static InvalidOperationException UnsupportedException(TypeDesc typeDesc, ImportContext context) 636TypeDesc typeDesc = _typeScope.GetTypeDesc(typeof(object)); 649TypeDesc typeDesc = baseMapping.TypeDesc!.GetNullableTypeDesc(type); 712private TypeMapping? GetTypeMapping(string? typeName, string? ns, TypeDesc typeDesc, NameTable typeLib, Type? type) 960TypeDesc typeDesc = _typeScope.GetTypeDesc(type); 1140private static void CheckContext(TypeDesc typeDesc, ImportContext context) 1330TypeDesc typeDesc = _typeScope.GetTypeDesc(xmlReflectionMember.MemberType!); 1513TypeDesc targetTypeDesc = _typeScope.GetTypeDesc(targetType); 1599TypeDesc targetTypeDesc = _typeScope.GetTypeDesc(targetType); 1629TypeDesc targetTypeDesc = _typeScope.GetTypeDesc(targetType); 1644TypeDesc targetTypeDesc = _typeScope.GetTypeDesc(targetType); 1704TypeDesc targetTypeDesc = _typeScope.GetTypeDesc(targetType); 1737TypeDesc arrayElementTypeDesc = _typeScope.GetTypeDesc(arrayElementType); 1886TypeDesc targetTypeDesc = _typeScope.GetTypeDesc(targetType); 1946TypeDesc targetTypeDesc = _typeScope.GetTypeDesc(targetType); 2144private static object? GetDefaultValue(TypeDesc fieldTypeDesc, Type t, XmlAttributes a) 2178private static XmlElementAttribute CreateElementAttribute(TypeDesc typeDesc) 2229private static void CheckNullable(bool isNullable, TypeDesc typeDesc, TypeMapping? mapping) 2263TypeDesc typeDesc = new TypeScope().GetTypeDesc(type);
System\Xml\Serialization\XmlSchemaImporter.cs (12)
497TypeDesc? baseTypeDesc = null; 613TypeDesc baseTypeDesc = Scope.GetTypeDesc(baseType); 818TypeDesc[] typeDescs = new TypeDesc[uniqueTypeDescs.Count]; 827TypeDesc.FindCommonBaseTypeDesc(typeDescs) ?? 1549TypeDesc xmlnsTypeDesc = Scope.GetTypeDesc(typeof(System.Xml.Serialization.XmlSerializerNamespaces)); 1737TypeDesc? sourceTypeDesc = TypeScope.GetTypeDesc((XmlSchemaSimpleType)sourceType); 1829TypeDesc sourceTypeDesc = GetDataTypeSource(dataType, flags); 1840TypeDesc? typeDesc; 1893private TypeDesc GetDataTypeSource(XmlSchemaSimpleType dataType, TypeFlags flags) 1895TypeDesc? typeDesc; 1918TypeDesc? typeDesc = TypeScope.GetTypeDesc(name.Name, name.Namespace, flags);
System\Xml\Serialization\XmlSerializationGeneratedCode.cs (4)
27private readonly TypeDesc? _stringTypeDesc; 28private readonly TypeDesc? _qnameTypeDesc; 53internal TypeDesc? StringTypeDesc { get { return _stringTypeDesc; } } 54internal TypeDesc? QnameTypeDesc { get { return _qnameTypeDesc; } }
System\Xml\Serialization\XmlSerializationILGen.cs (4)
28private readonly TypeDesc? _stringTypeDesc; 29private readonly TypeDesc? _qnameTypeDesc; 55internal TypeDesc? StringTypeDesc { get { return _stringTypeDesc; } } 56internal TypeDesc? QnameTypeDesc { get { return _qnameTypeDesc; } }
System\Xml\Serialization\XmlSerializationReader.cs (19)
2056private readonly TypeDesc _td; 2058internal CreateCollectionInfo(string name, TypeDesc td) 2068internal TypeDesc TypeDesc 2466private string GetChoiceIdentifierSource(MemberMapping mapping, string parent, TypeDesc parentTypeDesc) 2750private void WriteCreateCollection(TypeDesc td, string source) 3130TypeDesc td = arrayMapping.TypeDesc; 3520TypeDesc td = member.Mapping.TypeDesc!; 3559private void WriteAddCollectionFixup(TypeDesc typeDesc, bool readOnly, string memberSource, string targetSource) 3615TypeDesc td = c.TypeDesc; 3908TypeDesc typeDesc = member.Mapping.TypeDesc!; 4248TypeDesc td = ((NullableMapping)e.Mapping).BaseMapping!.TypeDesc!; 4288TypeDesc td = ((NullableMapping)e.Mapping).BaseMapping!.TypeDesc!; 4377private string GetArraySource(TypeDesc typeDesc, string arrayName) 4381private string GetArraySource(TypeDesc typeDesc, string arrayName, bool multiRef) 4426TypeDesc typeDesc = member.Mapping.TypeDesc!; 4488private void WriteSourceBeginTyped(string source, TypeDesc? typeDesc) 4535TypeDesc td = arrayMapping.TypeDesc!; 5100private void WriteCatchCastException(TypeDesc typeDesc, string source, string? id) 5119private void WriteArrayLocalDecl(string typeName, string variableName, string initValue, TypeDesc arrayTypeDesc)
System\Xml\Serialization\XmlSerializationReaderILGen.cs (6)
1252TypeDesc td = arrayMapping.TypeDesc; 2132TypeDesc typeDesc = member.Mapping.TypeDesc!; 2580private static string GetArraySource(TypeDesc typeDesc, string arrayName) 2584private static string GetArraySource(TypeDesc typeDesc, string arrayName, bool multiRef) 2625TypeDesc typeDesc = member.Mapping.TypeDesc!; 3478private void WriteArrayLocalDecl(string typeName, string variableName, string initValue, TypeDesc arrayTypeDesc)
System\Xml\Serialization\XmlSerializationWriter.cs (24)
821TypeDesc typeDesc = new TypeScope().GetTypeDesc(type); 1612TypeDesc typeDesc = scope.GetTypeDesc(type); 1619private string WriteTypeInfo(TypeScope scope, TypeDesc typeDesc, Type type) 1630TypeDesc elementTypeDesc = typeDesc.ArrayElementTypeDesc!; 1670TypeDesc elementTypeDesc = typeDesc.ArrayElementTypeDesc!; 1730private void WriteCollectionInfo(string typeVariable, TypeDesc typeDesc, 1929internal string GetStringForMember(string obj, string memberName, TypeDesc typeDesc) 1975internal string GetStringForArrayMember(string arrayName, string subscript, TypeDesc arrayTypeDesc) 2089internal void WriteArrayLocalDecl(string typeName, string variableName, string? initValue, TypeDesc arrayTypeDesc) 2417private void WritePrimitiveValue(TypeDesc typeDesc, string source) 2448TypeDesc typeDesc = mapping.TypeDesc!; 3278private bool CanOptimizeWriteListSequence(TypeDesc? listElementTypeDesc) 3288private void WriteMember(string source, AttributeAccessor attribute, TypeDesc memberTypeDesc, string parent) 3328TypeDesc arrayElementTypeDesc = memberTypeDesc.ArrayElementTypeDesc!; 3477TypeDesc typeDesc = attribute.Mapping!.TypeDesc!; 3484private void WriteMember(string source, string? choiceSource, ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice, TypeDesc memberTypeDesc, bool writeAccessors) 3494private void WriteArray(string source, string? choiceSource, ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice, TypeDesc arrayTypeDesc) 3534private void WriteArrayItems(ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice, TypeDesc arrayTypeDesc, string arrayName, string? choiceName) 3536TypeDesc arrayElementTypeDesc = arrayTypeDesc.ArrayElementTypeDesc!; 3647TypeDesc td = elements[0].IsUnbounded ? elements[0].Mapping!.TypeDesc!.CreateArrayTypeDesc() : elements[0].Mapping!.TypeDesc!; 3718TypeDesc td = element.IsUnbounded ? element.Mapping.TypeDesc.CreateArrayTypeDesc() : element.Mapping.TypeDesc; 3963TypeDesc td = arrayMapping.TypeDesc!.CreateArrayTypeDesc(); 4230private void WriteChoiceTypeCheck(string source, string fullTypeName, bool useReflection, ChoiceIdentifierAccessor choice, string enumName, TypeDesc typeDesc) 4423private void WriteArrayLocalDecl(string typeName, string variableName, string? initValue, TypeDesc arrayTypeDesc)
System\Xml\Serialization\XmlSerializationWriterILGen.cs (15)
143private void WritePrimitiveValue(TypeDesc typeDesc, SourceInfo source, out Type returnType) 193TypeDesc typeDesc = mapping.TypeDesc!; 1143private bool CanOptimizeWriteListSequence(TypeDesc? listElementTypeDesc) 1152private void WriteMember(SourceInfo source, AttributeAccessor attribute, TypeDesc memberTypeDesc, string parent) 1202TypeDesc arrayElementTypeDesc = memberTypeDesc.ArrayElementTypeDesc!; 1379TypeDesc typeDesc = attribute.Mapping!.TypeDesc!; 1404private void WriteMember(SourceInfo source, string? choiceSource, ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice, TypeDesc memberTypeDesc, bool writeAccessors) 1414private void WriteArray(SourceInfo source, string? choiceSource, ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice, TypeDesc arrayTypeDesc) 1475private void WriteArrayItems(ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice, TypeDesc arrayTypeDesc, string arrayName, string? choiceName) 1477TypeDesc arrayElementTypeDesc = arrayTypeDesc.ArrayElementTypeDesc!; 1569TypeDesc td = elements[0].IsUnbounded ? elements[0].Mapping!.TypeDesc!.CreateArrayTypeDesc() : elements[0].Mapping!.TypeDesc!; 1638TypeDesc td = element.IsUnbounded ? element.Mapping!.TypeDesc!.CreateArrayTypeDesc() : element.Mapping!.TypeDesc!; 2151private void WriteChoiceTypeCheck(SourceInfo source, ChoiceIdentifierAccessor choice, string enumName, TypeDesc typeDesc) 2220private static void WriteArrayLocalDecl(string typeName, string variableName, SourceInfo initValue, TypeDesc arrayTypeDesc) 2547internal static void WriteArrayLocalDecl(string typeName, string variableName, SourceInfo initValue, TypeDesc arrayTypeDesc)
System\Xml\Serialization\XmlSerializer.cs (4)
548TypeDesc typeDesc = (TypeDesc)TypeScope.PrimtiveTypes[_primitiveType]!; 847TypeDesc? typeDesc = (TypeDesc?)TypeScope.PrimtiveTypes[type];