30 writes to TypeDesc
System.Private.Xml (30)
System\Xml\Serialization\ReflectionXmlSerializationReader.cs (2)
455memberMapping.TypeDesc = mapping.TypeDesc; 1125TypeDesc = arrayMapping.TypeDesc,
System\Xml\Serialization\SoapReflectionImporter.cs (1)
687accessor.TypeDesc = _typeScope.GetTypeDesc(accessorType);
System\Xml\Serialization\XmlReflectionImporter.cs (2)
1543accessor.TypeDesc = _typeScope.GetTypeDesc(accessorType); 1558accessor.TypeDesc = _typeScope.GetArrayTypeDesc(accessorType);
System\Xml\Serialization\XmlSchemaImporter.cs (19)
209member.TypeDesc = accessor.Mapping!.TypeDesc; 815member.TypeDesc = Scope.GetTypeDesc(typeof(object)); 826member.TypeDesc = 832member.TypeDesc = member.TypeDesc.CreateArrayTypeDesc(); 857choiceIdentifier.TypeDesc = member.ChoiceIdentifier.Mapping.TypeDesc!.CreateArrayTypeDesc(); 861choiceIdentifier.TypeDesc = member.ChoiceIdentifier.Mapping.TypeDesc; 1144member.TypeDesc = accessor.Mapping.TypeDesc!.CreateArrayTypeDesc(); 1153member.TypeDesc = accessor.Mapping.TypeDesc!.CreateArrayTypeDesc(); 1158member.TypeDesc = accessor.Mapping.TypeDesc; 1176member.TypeDesc = ((TypeMapping)accessors[0].Mapping!).TypeDesc; 1185member.TypeDesc = textMapping.TypeDesc; 1195member.TypeDesc = member.TypeDesc!.CreateArrayTypeDesc(); 1434member.TypeDesc = accessor.Mapping.TypeDesc; 1438member.TypeDesc = accessor.Mapping.TypeDesc; 1452member.TypeDesc = accessor.Mapping.TypeDesc!.CreateArrayTypeDesc(); 1479member.TypeDesc = accessor.IsList ? accessor.Mapping!.TypeDesc!.CreateArrayTypeDesc() : accessor.Mapping!.TypeDesc; 1504member.TypeDesc = ((TypeMapping)accessor.Mapping).TypeDesc; 1505member.TypeDesc = member.TypeDesc.CreateArrayTypeDesc(); 1566member.TypeDesc = xmlnsTypeDesc;
System\Xml\Serialization\XmlSerializationReader.cs (3)
2797member.TypeDesc = mapping.TypeDesc; 3126memberMapping.TypeDesc = arrayMapping.TypeDesc; 4562memberMapping.TypeDesc = arrayMapping.TypeDesc;
System\Xml\Serialization\XmlSerializationReaderILGen.cs (3)
644member.TypeDesc = mapping.TypeDesc; 1246memberMapping.TypeDesc = arrayMapping.TypeDesc; 2861memberMapping.TypeDesc = arrayMapping.TypeDesc;
163 references to TypeDesc
System.Private.Xml (163)
System\Xml\Serialization\Mappings.cs (4)
598if (_members[i].TypeDesc != member.TypeDesc) 599throw new InvalidOperationException(SR.Format(SR.XmlHiddenMember, parent, member.Name, member.TypeDesc!.FullName, this.TypeName, _members[i].Name, _members[i].TypeDesc!.FullName));
System\Xml\Serialization\ReflectionXmlSerializationReader.cs (19)
224else if (mapping.TypeDesc!.IsArrayLike 275SetCollectionObjectWithCollectionMember(ref value, member.Collection!, member.Mapping.TypeDesc!.Type!); 282SetCollectionObjectWithCollectionMember(ref value, anyAttribute.Collection!, anyAttribute.Mapping.TypeDesc!.Type!); 293if (!mappings[i].TypeDesc!.IsValueType) 297if (mappings[i].TypeDesc!.IsOptionalValue && mappings[i].TypeDesc!.BaseTypeDesc!.UseReflection) 303p[i] = ReflectionCreateObject(mappings[i].TypeDesc!.Type!); 697if (anyTextMapping.TypeDesc!.IsArrayLike) 814bool isList = member!.Mapping.TypeDesc!.IsArrayLike && !member.Mapping.TypeDesc.IsArray; 815WriteElement(e, isList && member.Mapping.TypeDesc.IsNullable, member.Mapping.ReadOnly, ns, member.FixupIndex, fixup, member); 1129Type collectionType = memberMapping.TypeDesc!.Type!; 1130o = ReflectionCreateObject(memberMapping.TypeDesc.Type!); 1350TypeDesc td = member.Mapping.TypeDesc!; 1444TypeDesc typeDesc = member.Mapping.TypeDesc!; 1632if (mapping.TypeDesc!.IsArrayLike) 1634if (member.Source == null && mapping.TypeDesc.IsArrayLike && !(mapping.Elements!.Length == 1 && mapping.Elements[0].Mapping is ArrayMapping)) 1756SetCollectionObjectWithCollectionMember(ref collection, member.Collection, member.Mapping.TypeDesc!.Type!); 1936Array arrayValue = Array.CreateInstance(member.Mapping.TypeDesc!.Type!.GetElementType()!, vals.Length);
System\Xml\Serialization\ReflectionXmlSerializationWriter.cs (4)
599WriteMember(memberValue, m.Attribute, m.TypeDesc!, o); 642WriteMember(memberValue, choiceSource, m.ElementsSortedByDerivation!, m.Text, m.ChoiceIdentifier, m.TypeDesc!, true); 1234WriteMember(source, member.Attribute, member.TypeDesc!, null); 1288WriteMember(source, enumSource, member.ElementsSortedByDerivation!, member.Text, member.ChoiceIdentifier, member.TypeDesc!, writeAccessors || hasWrapperElement);
System\Xml\Serialization\SoapReflectionImporter.cs (9)
398if (!member.TypeDesc!.IsPrimitive && !member.TypeDesc.IsEnum && !member.TypeDesc.IsOptionalValue) 402if (member.TypeDesc.IsValueType) 403throw new NotSupportedException(SR.Format(SR.XmlRpcNestedValueType, member.TypeDesc.FullName)); 688if (accessor.TypeDesc.IsVoid) 696if (!accessor.TypeDesc.IsPrimitive && !accessor.TypeDesc.IsEnum) 697throw new InvalidOperationException(SR.Format(SR.XmlIllegalSoapAttribute, accessorName, accessor.TypeDesc.FullName));
System\Xml\Serialization\Types.cs (1)
1074if (propertyInfo != null && !CanWriteProperty(propertyInfo, memberMapping.TypeDesc!))
System\Xml\Serialization\XmlMemberMapping.cs (1)
87get { return _mapping.TypeDesc!.FullName; }
System\Xml\Serialization\XmlMembersMapping.cs (2)
26if (mapping.Members[i].TypeDesc!.Type != null) 28key.Append(GenerateKey(mapping.Members[i].TypeDesc!.Type!, null, null));
System\Xml\Serialization\XmlReflectionImporter.cs (22)
1569if (accessor.TypeDesc.IsArrayLike) 1578if (a.XmlAttribute != null && !accessor.TypeDesc.ArrayElementTypeDesc!.IsPrimitive && !accessor.TypeDesc.ArrayElementTypeDesc.IsEnum) 1580if (accessor.TypeDesc.ArrayElementTypeDesc.Kind == TypeKind.Serializable) 1582throw new InvalidOperationException(SR.Format(SR.XmlIllegalAttrOrTextInterface, accessorName, accessor.TypeDesc.ArrayElementTypeDesc.FullName, nameof(IXmlSerializable))); 1586throw new InvalidOperationException(SR.Format(SR.XmlIllegalAttrOrText, accessorName, accessor.TypeDesc.ArrayElementTypeDesc.FullName)); 1590bool isList = a.XmlAttribute != null && (accessor.TypeDesc.ArrayElementTypeDesc!.IsPrimitive || accessor.TypeDesc.ArrayElementTypeDesc.IsEnum); 1638a.XmlElements.Add(CreateElementAttribute(accessor.TypeDesc)); 1751CheckNullable(arrayElement.IsNullable, accessor.TypeDesc, arrayElement.Mapping); 1764else if (!accessor.TypeDesc.IsVoid) 1770if (accessor.TypeDesc.IsPrimitive || accessor.TypeDesc.IsEnum) 1772if (a.XmlAnyElements.Count > 0) throw new InvalidOperationException(SR.Format(SR.XmlIllegalAnyElement, accessor.TypeDesc.FullName)); 1811a.XmlElements.Add(CreateElementAttribute(accessor.TypeDesc)); 1819if (_typeScope.GetTypeDesc(xmlElement.Type) != accessor.TypeDesc) 1838CheckNullable(element.IsNullable, accessor.TypeDesc, element.Mapping); 1871if (accessor.TypeDesc.Kind == TypeKind.Serializable) 1873throw new InvalidOperationException(SR.Format(SR.XmlIllegalAttrOrTextInterface, accessorName, accessor.TypeDesc.FullName, nameof(IXmlSerializable))); 1877throw new InvalidOperationException(SR.Format(SR.XmlIllegalAttrOrText, accessorName, accessor.TypeDesc)); 1881a.XmlElements.Add(CreateElementAttribute(accessor.TypeDesc)); 1977if (accessor.TypeDesc.IsArrayLike && accessor.Elements.Length > 0 && !(accessor.Elements[0].Mapping is ArrayMapping))
System\Xml\Serialization\XmlSchemaExporter.cs (7)
85if (member.TypeDesc!.IsArrayLike && !(member.Elements[0].Mapping is ArrayMapping)) 172bool isUnbounded = member.Mapping.TypeDesc!.IsArrayLike; 173bool isMixed = isUnbounded && member.Mapping.TypeDesc.ArrayElementTypeDesc != null ? member.Mapping.TypeDesc.ArrayElementTypeDesc.IsMixed : member.Mapping.TypeDesc.IsMixed; 175if (isMixed && member.Mapping.TypeDesc.IsMixed) 1057bool repeats = member.TypeDesc!.IsArrayLike &&
System\Xml\Serialization\XmlSchemaImporter.cs (12)
590if (baseMember != null && baseMember.TypeDesc != structMapping.Members[i].TypeDesc) 591throw new InvalidOperationException(SR.Format(SR.XmlIllegalOverride, type.Name, baseMember.Name, baseMember.TypeDesc!.FullName, structMapping.Members[i].TypeDesc!.FullName, declaringMapping!.TypeDesc!.FullName)); 832member.TypeDesc = member.TypeDesc.CreateArrayTypeDesc(); 1195member.TypeDesc = member.TypeDesc!.CreateArrayTypeDesc(); 1294arrayMapping.TypeDesc = choiceMember.TypeDesc; 1455if (element.MinOccurs == 0 && member.TypeDesc!.IsValueType && !element.HasDefault && !member.TypeDesc.HasIsEmpty) 1481if ((attribute.Use == XmlSchemaUse.Optional || attribute.Use == XmlSchemaUse.None) && member.TypeDesc!.IsValueType && !attribute.HasDefault && !member.TypeDesc.HasIsEmpty) 1505member.TypeDesc = member.TypeDesc.CreateArrayTypeDesc();
System\Xml\Serialization\XmlSerializationReader.cs (31)
2117if (mapping.TypeDesc!.IsArrayLike) 2122_arraySource = outerClass.GetArraySource(mapping.TypeDesc, _arrayName, multiRef); 2123_isArray = mapping.TypeDesc.IsArray; 2127_choiceArraySource = outerClass.GetArraySource(mapping.TypeDesc, _choiceArrayName, multiRef); 2513arraySource = $"(({mapping.TypeDesc!.CSharpName}){source})"; 2557else if (mapping.TypeDesc!.IsArrayLike && !(mapping.Elements!.Length == 1 && mapping.Elements[0].Mapping is ArrayMapping)) 2564if (mapping.TypeDesc.IsArrayLike && !mapping.TypeDesc.IsArray) 2631if (!mappings[i].TypeDesc!.IsValueType) 2638if (mappings[i].TypeDesc!.IsOptionalValue && mappings[i].TypeDesc!.BaseTypeDesc!.UseReflection) 2644Writer.Write(RaCodeGen.GetStringForCreateInstance(mappings[i].TypeDesc!.CSharpName, mappings[i].TypeDesc!.UseReflection, false, false)); 2693arraySource = $"(({mapping.TypeDesc!.CSharpName}){source})"; 3321member.IsNullable = mapping.TypeDesc!.IsNullable; 3357if (mapping.TypeDesc.IsArrayLike) 3360if (mapping.TypeDesc.IsArrayLike && !(mapping.Elements!.Length == 1 && mapping.Elements[0].Mapping is ArrayMapping)) 3368else if (!mapping.TypeDesc.IsArray) 3520TypeDesc td = member.Mapping.TypeDesc!; 3531WriteSourceBeginTyped(memberSource, member.Mapping.TypeDesc); 3548WriteCatchCastException(member.Mapping.TypeDesc!, targetSource, $"ids[{fixupIndex}]"); 3737Writer.Write(xmlnsMember.Mapping.TypeDesc!.CSharpName); 3741Writer.Write($"(({xmlnsMember.Mapping.TypeDesc.CSharpName}){xmlnsMember.ArraySource})"); 3833string attributeSource = GetArraySource(member.Mapping.TypeDesc!, member.ArrayName); 3908TypeDesc typeDesc = member.Mapping.TypeDesc!; 3911if (member.Mapping.TypeDesc!.IsArray) 3944if (member.IsList && !member.Mapping.ReadOnly && member.Mapping.TypeDesc.IsNullable) 3950if (!member.Mapping.TypeDesc.HasDefaultConstructor) 3953WriteQuotedCSharpString(member.Mapping.TypeDesc.CSharpName); 4314WriteElement(member.ArraySource, member.ArrayName, member.ChoiceArraySource, e, choice, member.Mapping.CheckSpecified == SpecifiedAccessor.ReadWrite ? member.CheckSpecifiedSource : null, member.IsList && member.Mapping.TypeDesc!.IsNullable, member.Mapping.ReadOnly, member.FixupIndex, j); 4426TypeDesc typeDesc = member.Mapping.TypeDesc!;
System\Xml\Serialization\XmlSerializationReaderILGen.cs (39)
79if (mapping.TypeDesc!.IsArrayLike) 84_arraySource = XmlSerializationReaderILGen.GetArraySource(mapping.TypeDesc, _arrayName, multiRef); 85_isArray = mapping.TypeDesc.IsArray; 89_choiceArraySource = XmlSerializationReaderILGen.GetArraySource(mapping.TypeDesc, _choiceArrayName, multiRef); 440arraySource = $"(({mapping.TypeDesc!.CSharpName}){source})"; 484else if (mapping.TypeDesc!.IsArrayLike && !(mapping.Elements!.Length == 1 && mapping.Elements[0].Mapping is ArrayMapping)) 491if (mapping.TypeDesc.IsArrayLike && !mapping.TypeDesc.IsArray) 616if (!mappings[i].TypeDesc!.IsValueType) 621ReflectionAwareILGen.ILGenForCreateInstance(ilg, mappings[i].TypeDesc!.Type!, false, false); 622ilg.ConvertValue(mappings[i].TypeDesc!.Type!, typeof(object)); 1545member.IsNullable = mapping.TypeDesc!.IsNullable; 1581if (mapping.TypeDesc.IsArrayLike) 1584if (mapping.TypeDesc.IsArrayLike && !(mapping.Elements!.Length == 1 && mapping.Elements[0].Mapping is ArrayMapping)) 1592else if (!mapping.TypeDesc.IsArray) 1899ConstructorInfo ctor = xmlnsMember.Mapping.TypeDesc!.Type!.GetConstructor( 1904WriteSourceEnd(xmlnsMember.Source, xmlnsMember.Mapping.TypeDesc.Type!); 1909MethodInfo Add = xmlnsMember.Mapping.TypeDesc.Type!.GetMethod( 1919ILGenLoad(xmlnsMember.ArraySource, xmlnsMember.Mapping.TypeDesc.Type); 2041WriteSourceEnd(member.ArraySource, member.Mapping.TypeDesc!.IsArrayLike ? member.Mapping.TypeDesc.ArrayElementTypeDesc!.Type! : member.Mapping.TypeDesc.Type!); 2059WriteSourceEnd(member.ArraySource, member.Mapping.TypeDesc!.IsArrayLike ? member.Mapping.TypeDesc.ArrayElementTypeDesc!.Type! : member.Mapping.TypeDesc.Type!); 2097string attributeSource = GetArraySource(member.Mapping.TypeDesc!, member.ArrayName); 2101WriteSourceEnd(attributeSource, member.Mapping.TypeDesc!.ArrayElementTypeDesc!.Type!); 2108WriteSourceEnd(member.ArraySource, member.Mapping.TypeDesc!.IsArrayLike ? member.Mapping.TypeDesc.ArrayElementTypeDesc!.Type! : member.Mapping.TypeDesc.Type!); 2132TypeDesc typeDesc = member.Mapping.TypeDesc!; 2134if (member.Mapping.TypeDesc!.IsArray) 2167if (!member.Mapping.TypeDesc.HasDefaultConstructor) 2175ilg.Ldstr(GetCSharpString(member.Mapping.TypeDesc.CSharpName)); 2182ReflectionAwareILGen.ILGenForCreateInstance(ilg, member.Mapping.TypeDesc.Type!, typeDesc.CannotNew, true); 2183WriteSourceEnd(member.Source, member.Mapping.TypeDesc.Type!); 2187WriteLocalDecl(a, new SourceInfo(member.Source, member.Source, member.Mapping.MemberInfo, member.Mapping.TypeDesc.Type, ilg)); 2533WriteElement(member.ArraySource, member.ArrayName, member.ChoiceArraySource, e, choice, member.Mapping.CheckSpecified == SpecifiedAccessor.ReadWrite ? member.CheckSpecifiedSource : null, member.IsList && member.Mapping.TypeDesc!.IsNullable, member.Mapping.ReadOnly, member.FixupIndex, j); 2625TypeDesc typeDesc = member.Mapping.TypeDesc!;
System\Xml\Serialization\XmlSerializationWriter.cs (6)
2686WriteMember(source, member.Attribute, member.TypeDesc!, "p"); 2752enumSource = $"(({mapping.Members[j].TypeDesc!.CSharpName })p[{j}])"; 2773WriteMember(source, enumSource, member.ElementsSortedByDerivation!, member.Text, member.ChoiceIdentifier, member.TypeDesc!, writeAccessors || hasWrapperElement); 3158xmlnsSource = $"(({member.TypeDesc!.CSharpName}){xmlnsSource})"; 3208WriteMember(RaCodeGen.GetStringForMember("o", m.Name, mapping.TypeDesc), m.Attribute, m.TypeDesc!, "o"); 3256WriteMember(RaCodeGen.GetStringForMember("o", m.Name, mapping.TypeDesc), choiceSource, m.ElementsSortedByDerivation!, m.Text, m.ChoiceIdentifier, m.TypeDesc!, true);
System\Xml\Serialization\XmlSerializationWriterILGen.cs (6)
448WriteMember(source, member.Attribute, member.TypeDesc!, "p"); 512enumSource = $"(({mapping.Members[j].TypeDesc!.CSharpName})p[{j}])"; 524WriteMember(new SourceInfo(source, source, null, null, ilg), enumSource, member.ElementsSortedByDerivation!, member.Text, member.ChoiceIdentifier, member.TypeDesc!, writeAccessors || hasWrapperElement); 1086WriteMember(ReflectionAwareILGen.GetSourceForMember("o", m, ilg), m.Attribute, m.TypeDesc!, "o"); 1127WriteMember(ReflectionAwareILGen.GetSourceForMember("o", m, m.MemberInfo, ilg), choiceSource, m.ElementsSortedByDerivation!, m.Text, m.ChoiceIdentifier, m.TypeDesc!, true); 2337return new SourceInfo(GetStringForMember(obj, member.Name), obj, memberInfo, member.TypeDesc!.Type, ilg);