191 references to Type
System.Private.Xml (191)
System\Xml\Serialization\Compilation.cs (1)
455
VerifyLoadContext(mapping.Accessor.Mapping?.TypeDesc?.
Type
, mainAssembly);
System\Xml\Serialization\ReflectionXmlSerializationReader.cs (26)
45
mapping.TypeDesc.
Type
!,
275
SetCollectionObjectWithCollectionMember(ref value, member.Collection!, member.Mapping.TypeDesc!.
Type
!);
282
SetCollectionObjectWithCollectionMember(ref value, anyAttribute.Collection!, anyAttribute.Mapping.TypeDesc!.
Type
!);
303
p[i] = ReflectionCreateObject(mappings[i].TypeDesc!.
Type
!);
770
elementType = td.
Type
!;
774
elementType = ele.Mapping!.TypeDesc!.
Type
!;
861
value = ReflectionCreateObject(element.Mapping.TypeDesc.
Type
!);
873
else if (element.Mapping.TypeDesc!.
Type
== typeof(TimeSpan) && Reader.IsEmptyElement)
878
else if (element.Mapping.TypeDesc!.
Type
== typeof(DateTimeOffset) && Reader.IsEmptyElement)
985
value = ReadSerializable((IXmlSerializable)ReflectionCreateObject(sm.TypeDesc!.
Type
!)!, isWrappedAny);
1129
Type collectionType = memberMapping.TypeDesc!.
Type
!;
1130
o = ReflectionCreateObject(memberMapping.TypeDesc.
Type
!);
1238
object? o = Activator.CreateInstance(nullableMapping.TypeDesc!.
Type
!);
1270
return Enum.ToObject(mapping.TypeDesc!.
Type
!, ToEnum(source, table, mapping.TypeDesc.Name));
1278
return Enum.Parse(mapping.TypeDesc!.
Type
!, c.Name);
1282
throw CreateUnknownConstantException(source, mapping.TypeDesc!.
Type
!);
1341
object? o = ReflectionCreateObject(structMapping.TypeDesc.
Type
!);
1462
memberSource = ReflectionCreateObject(typeDesc.
Type
!);
1468
new XmlSerializationCollectionFixupCallback(GetCreateCollectionOfObjectsCallback(typeDesc.
Type
!)),
1523
return ReflectionCreateObject(structMapping.TypeDesc.
Type
!);
1567
if (structMapping.TypeDesc.
Type
!= null && typeof(XmlSchemaObject).IsAssignableFrom(structMapping.TypeDesc.
Type
))
1574
object? o = ReflectionCreateObject(structMapping.TypeDesc.
Type
!)!;
1705
object choiceValue = Enum.Parse(choice.Mapping!.TypeDesc!.
Type
!, name);
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 (12)
49
mapping.TypeDesc.
Type
!,
104
if (!mapping.TypeDesc!.IsValueType && !mapping.TypeDesc.
Type
!.IsPrimitive)
219
if (o != null && o.GetType() == element.Mapping!.TypeDesc!.
Type
)
228
if (o!.GetType() == td.
Type
)
350
WritePotentiallyReferencingElement(name, ns, o, mapping.TypeDesc!.
Type
, true, element.IsNullable);
423
WritePotentiallyReferencingElement(name, ns, o, !writeAccessor ? mapping.TypeDesc!.
Type
: null, !writeAccessor, element.IsNullable);
520
&& o.GetType() != mapping.TypeDesc!.
Type
)
544
if (mapping.TypeDesc.
Type
!= null && typeof(XmlSchemaObject).IsAssignableFrom(mapping.TypeDesc.
Type
))
666
if (m is EnumMapping em && em.TypeDesc!.
Type
== objType)
675
if (m is ArrayMapping am && am.TypeDesc!.
Type
== objType)
911
if (t == derived.TypeDesc!.
Type
)
System\Xml\Serialization\SoapReflectionImporter.cs (3)
203
SoapAttributes baseAttributes = GetAttributes(baseTypeDesc!.
Type
!);
211
ImportTypeMapping(_modelScope.GetTypeModel(baseTypeDesc.
Type
!), dataType, limiter);
212
return CreateNullableMapping(baseMapping, model.TypeDesc.
Type
!);
System\Xml\Serialization\SourceInfo.cs (1)
52
return new SourceInfo($"(({td.CSharpName}){Source})", Arg, MemberInfo, td.
Type
!, ILG);
System\Xml\Serialization\Types.cs (3)
743
if (typeDesc.
Type
!= null)
744
return typeDesc.
Type
;
1130
if (ShouldBeReplaced(pair.Value, structMapping.TypeDesc!.
Type
!, out replacedInfo))
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 (2)
451
ImportTypeMapping(_modelScope.GetTypeModel(model.TypeDesc.BaseTypeDesc!.
Type
!), ns, context, dataType, null, repeats, openModel, limiter);
452
return CreateNullableMapping(baseMapping, model.TypeDesc.
Type
!);
System\Xml\Serialization\XmlSchemaExporter.cs (2)
914
if (pm.TypeDesc.
Type
== null)
924
System.Reflection.MethodInfo? format = formatter.GetMethod("ToString", new Type[] { pm.TypeDesc.
Type
! });
System\Xml\Serialization\XmlSerializationGeneratedCode.cs (1)
346
Type? type = xmlMappings[i].Accessor.Mapping!.TypeDesc!.
Type
;
System\Xml\Serialization\XmlSerializationILGen.cs (1)
448
Type? type = xmlMappings[i].Accessor.Mapping!.TypeDesc!.
Type
;
System\Xml\Serialization\XmlSerializationReader.cs (6)
3296
if (structMapping.TypeDesc.
Type
!= null && typeof(XmlSchemaObject).IsAssignableFrom(structMapping.TypeDesc.
Type
))
4679
if (element.Mapping.TypeDesc!.
Type
== typeof(TimeSpan) || element.Mapping.TypeDesc!.
Type
== typeof(DateTimeOffset))
4685
if (element.Mapping.TypeDesc!.
Type
== typeof(TimeSpan))
4689
else if (element.Mapping.TypeDesc!.
Type
== typeof(DateTimeOffset))
System\Xml\Serialization\XmlSerializationReaderILGen.cs (68)
621
ReflectionAwareILGen.ILGenForCreateInstance(ilg, mappings[i].TypeDesc!.
Type
!, false, false);
622
ilg.ConvertValue(mappings[i].TypeDesc!.
Type
!, typeof(object));
691
mapping.TypeDesc!.
Type
,
993
ilg.Ldc(Enum.ToObject(mapping.TypeDesc!.
Type
!, constants[i].Value));
994
ilg.ConvertValue(mapping.TypeDesc.
Type
!, typeof(long));
1029
returnType = mapping.TypeDesc.
Type
!;
1096
retValues.Add(Enum.ToObject(mapping.TypeDesc.
Type
!, c.Value));
1119
ilg.Ldc(mapping.TypeDesc.
Type
!);
1158
derived.TypeDesc.
Type
,
1203
enumMapping.TypeDesc!.
Type
,
1253
LocalBuilder aLoc = ilg.DeclareLocal(arrayMapping.TypeDesc.
Type
!, aVar);
1256
ReflectionAwareILGen.ILGenForCreateInstance(ilg, td.
Type
!, false, false);
1280
nullableMapping.TypeDesc!.
Type
!,
1286
LocalBuilder oLoc = ilg.DeclareLocal(nullableMapping.TypeDesc.
Type
!, "o");
1289
ilg.InitObj(nullableMapping.TypeDesc.
Type
!);
1340
structMapping.TypeDesc.
Type
!,
1511
if (structMapping.TypeDesc.
Type
!= null && typeof(XmlSchemaObject).IsAssignableFrom(structMapping.TypeDesc.
Type
))
1686
ilg.Ldloc(structMapping.TypeDesc.
Type
!, "o");
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
!);
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
!);
2154
WriteCreateInstance(a, typeDesc.CannotNew, typeDesc.
Type
!);
2157
WriteSourceEnd(member.Source, typeDesc.
Type
!);
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));
2353
WriteSourceEnd(member.ArraySource, special.TypeDesc.
Type
!);
2415
WriteSourceEnd(member.ArraySource, text.Mapping.TypeDesc.
Type
!);
2644
ilg.Ldc(typeDesc.ArrayElementTypeDesc!.
Type
!);
2647
ilg.ConvertValue(XmlSerializationReader_ShrinkArray.ReturnType, typeDesc.
Type
!);
2648
WriteSourceEnd(member.Source, typeDesc.
Type
!);
2659
ilg.Ldc(member.Mapping.ChoiceIdentifier.Mapping!.TypeDesc!.
Type
!);
2662
ilg.ConvertValue(XmlSerializationReader_ShrinkArray.ReturnType, member.Mapping.ChoiceIdentifier.Mapping.TypeDesc.
Type
!.MakeArrayType());
2663
WriteSourceEnd(member.ChoiceSource!, member.Mapping.ChoiceIdentifier.Mapping.TypeDesc.
Type
!.MakeArrayType());
2988
element.Mapping.TypeDesc!.
Type
,
2992
WriteSourceEnd(source, element.Mapping.TypeDesc.
Type
!);
3016
WriteSourceEnd(source, element.Mapping.TypeDesc.
Type
!);
3051
if ((element.Mapping.TypeDesc!.
Type
== typeof(TimeSpan)) || element.Mapping.TypeDesc!.
Type
== typeof(DateTimeOffset))
3076
LocalBuilder tmpLoc = ilg.GetTempLocal(element.Mapping.TypeDesc!.
Type
);
3078
ilg.InitObj(element.Mapping.TypeDesc!.
Type
);
3080
WriteSourceEnd(source, element.Mapping.TypeDesc.
Type
);
3084
WriteSourceEnd(source, element.Mapping.TypeDesc.
Type
);
3116
WriteSourceEnd(source, element.Mapping.TypeDesc.
Type
!);
3164
mapping.TypeDesc.
Type
,
3168
WriteSourceEnd(source, mapping.TypeDesc.
Type
!);
3190
ilg.Castclass(special.TypeDesc.
Type
!);
3191
WriteSourceEnd(source, special.TypeDesc!.
Type
!);
3229
ReflectionAwareILGen.ILGenForCreateInstance(ilg, sm.TypeDesc!.
Type
!, sm.TypeDesc.CannotNew, false);
3237
ilg.ConvertValue(typeof(IXmlSerializable), sm.TypeDesc.
Type
!);
3238
WriteSourceEnd(source, sm.TypeDesc!.
Type
!);
3262
ReflectionAwareILGen.ILGenForEnumMember(ilg, choice.Mapping!.TypeDesc!.
Type
!, choice.MemberIds[elementIndex]);
3263
WriteSourceEnd(choiceSource!, choice.Mapping.TypeDesc.
Type
!);
3300
ReflectionAwareILGen.ILGenForCreateInstance(ilg, derived.TypeDesc!.
Type
!, derived.TypeDesc.CannotNew, false);
3308
ilg.ConvertValue(typeof(IXmlSerializable), head.TypeDesc.
Type
!);
3309
WriteSourceEnd(source, head.TypeDesc!.
Type
!);
3434
mapping.TypeDesc.
Type
!,
3441
ReflectionAwareILGen.ILGenForCreateInstance(ilg, mapping.TypeDesc.
Type
!, mapping.TypeDesc.CannotNew, true);
3480
ReflectionAwareILGen.WriteArrayLocalDecl(typeName, variableName, new SourceInfo(initValue, initValue, null, arrayTypeDesc.
Type
, ilg), arrayTypeDesc);
System\Xml\Serialization\XmlSerializationWriter.cs (5)
2840
if (!mapping.IsSoap && !mapping.TypeDesc!.IsValueType && !mapping.TypeDesc.
Type
!.IsPrimitive)
3143
if (mapping.TypeDesc.
Type
!= null && typeof(XmlSchemaObject).IsAssignableFrom(mapping.TypeDesc.
Type
))
4216
Type? type = Type.GetType(mapping.TypeDesc!.
Type
!.FullName!);
4224
Type? type = Type.GetType(mapping.TypeDesc!.
Type
!.FullName!);
System\Xml\Serialization\XmlSerializationWriterILGen.cs (58)
110
source.Load(mapping.TypeDesc!.
Type
!);
111
argTypes.Add(mapping.TypeDesc.
Type
!);
136
new Type[] { mapping.TypeDesc!.
Type
! });
138
source.Load(mapping.TypeDesc.
Type
!);
147
source.Load(typeDesc.
Type
!);
148
returnType = typeDesc.
Type
!;
154
Type argType = typeDesc.
Type
!;
166
source.Load(typeDesc.
Type
!);
182
new Type[] { typeDesc.
Type
! }
184
source.Load(typeDesc.
Type
!);
204
source.Load(mapping.TypeDesc!.
Type
!);
222
ilg.Ldc(Enum.Parse(mapping.TypeDesc.
Type
!, enumDefaultValue!, false));
574
if (!mapping.TypeDesc!.IsValueType && !mapping.TypeDesc.
Type
!.IsPrimitive)
602
argTypes.Add(mapping.TypeDesc!.
Type
!);
624
LocalBuilder localTmp = ilg.DeclareLocal(mapping.TypeDesc.
Type
!, "localTmp");
634
ilg.Ldc(Enum.ToObject(mapping.TypeDesc.
Type
!, c.Value));
719
ilg.ConvertValue(mapping.TypeDesc.
Type
!, typeof(long));
741
WriteTypeCompare("t", derived.TypeDesc!.
Type
!);
760
ilg.ConvertValue(oType, derived.TypeDesc.
Type
!);
761
argTypes.Add(derived.TypeDesc.
Type
!);
791
WriteTypeCompare("t", mapping.TypeDesc!.
Type
!);
829
new Type[] { mapping.TypeDesc.
Type
! }
841
ilg.ConvertValue(CodeGenerator.GetVariableType(oVar), mapping.TypeDesc.
Type
!);
860
WriteArrayTypeCompare("t", mapping.TypeDesc.
Type
!);
862
WriteTypeCompare("t", mapping.TypeDesc.
Type
!);
921
argTypes.Add(mapping.TypeDesc!.
Type
!);
969
WriteTypeCompare("t", mapping.TypeDesc.
Type
!);
1009
if (mapping.TypeDesc.
Type
!= null && typeof(XmlSchemaObject).IsAssignableFrom(mapping.TypeDesc.
Type
))
1165
ilg.Ldloc(memberTypeDesc.
Type
!, aVar);
1212
WriteLocalDecl(aiVar, ReflectionAwareILGen.GetStringForArrayMember(aVar, iVar), arrayElementTypeDesc.
Type
!);
1264
WriteEnumValue((EnumMapping)attribute.Mapping, new SourceInfo(aiVar, aiVar, null, arrayElementTypeDesc.
Type
, ilg), out argType);
1266
WritePrimitiveValue(arrayElementTypeDesc, new SourceInfo(aiVar, aiVar, null, arrayElementTypeDesc.
Type
, ilg), out argType);
1494
ilg.ConvertValue(arrayTypeDesc.
Type
!, typeIEnumerable);
1498
Type typeIEnumerable = typeof(IEnumerable<>).MakeGenericType(arrayElementTypeDesc.
Type
!);
1505
ilg.ConvertValue(arrayTypeDesc.
Type
!, typeIEnumerable);
1509
getEnumeratorMethod = arrayTypeDesc.
Type
!.GetMethod(
1523
WriteLocalDecl(arrayNamePlusI, "e.Current", arrayElementTypeDesc.
Type
!);
1524
WriteElements(new SourceInfo(arrayNamePlusI, null, null, arrayElementTypeDesc.
Type
, ilg), $"{choiceName}i", elements, text, choice, arrayNamePlusA, true, true);
1549
WriteLocalDecl(arrayNamePlusI, ReflectionAwareILGen.GetStringForArrayMember(arrayName, iPlusArrayName), arrayElementTypeDesc.
Type
!);
1552
WriteLocalDecl($"{choiceName}i", ReflectionAwareILGen.GetStringForArrayMember(choiceName, iPlusArrayName), choice.Mapping!.TypeDesc!.
Type
!);
1554
WriteElements(new SourceInfo(arrayNamePlusI, null, null, arrayElementTypeDesc.
Type
, ilg), $"{choiceName}i", elements, text, choice, arrayNamePlusA, true, arrayElementTypeDesc.IsNullable);
1558
WriteElements(new SourceInfo(ReflectionAwareILGen.GetStringForArrayMember(arrayName, iPlusArrayName), null, null, arrayElementTypeDesc.
Type
, ilg), null, elements, text, choice, arrayNamePlusA, true, arrayElementTypeDesc.IsNullable);
1613
ILGenLoad(enumSource!, choice == null ? null : choice.Mapping!.TypeDesc!.
Type
);
1641
WriteInstanceOf(source, td.
Type
!);
1690
ILGenLoad(enumSource!, choice == null ? null : choice.Mapping!.TypeDesc!.
Type
);
1807
WriteInstanceOf(source, text.Mapping!.TypeDesc!.
Type
!);
1902
if (source.Type == element.Mapping.TypeDesc!.
Type
)
1904
MethodInfo Nullable_get_HasValue = element.Mapping.TypeDesc.
Type
!.GetMethod(
1909
source.LoadAddress(element.Mapping.TypeDesc.
Type
);
2002
source.Load(structMapping.TypeDesc!.
Type
);
2003
argTypes.Add(structMapping.TypeDesc.
Type
!);
2158
WriteInstanceOf(source, typeDesc.
Type
!);
2253
eValue = Enum.ToObject(choiceMapping.TypeDesc!.
Type
!, choiceMapping.Constants[i].Value);
2267
eValue = Enum.ToObject(choiceMapping.TypeDesc!.
Type
!, choiceMapping.Constants[i].Value);
2337
return new SourceInfo(GetStringForMember(obj, member.Name), obj, memberInfo, member.TypeDesc!.
Type
, ilg);
2550
Type localType = (typeName == arrayTypeDesc.CSharpName) ? arrayTypeDesc.
Type
! : arrayTypeDesc.
Type
!.MakeArrayType();