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