206 references to Type
System.Private.Xml (206)
System\Xml\Serialization\Compilation.cs (1)
500
VerifyLoadContext(mapping.Accessor.Mapping?.TypeDesc?.
Type
, contextAssembly);
System\Xml\Serialization\ReflectionXmlSerializationReader.cs (33)
52
mapping.TypeDesc.
Type
!,
283
SetCollectionObjectWithCollectionMember(ref value, member.Collection!, member.Mapping.TypeDesc!.
Type
!);
290
SetCollectionObjectWithCollectionMember(ref value, anyAttribute.Collection!, anyAttribute.Mapping.TypeDesc!.
Type
!);
311
p[i] = ReflectionCreateObject(mappings[i].TypeDesc!.
Type
!);
807
elementType = td.
Type
!;
811
elementType = ele.Mapping!.TypeDesc!.
Type
!;
919
value = ReflectionCreateObject(element.Mapping.TypeDesc.
Type
!);
931
else if (element.Mapping.TypeDesc!.
Type
== typeof(TimeSpan) && Reader.IsEmptyElement)
936
else if (element.Mapping.TypeDesc!.
Type
== typeof(DateTimeOffset) && Reader.IsEmptyElement)
941
else if (element.Mapping.TypeDesc!.
Type
== typeof(DateOnly) && Reader.IsEmptyElement)
946
else if (element.Mapping.TypeDesc!.
Type
== typeof(TimeOnly) && Reader.IsEmptyElement)
1044
value = ReadSerializable((IXmlSerializable)ReflectionCreateObject(sm.TypeDesc!.
Type
!)!, isWrappedAny);
1065
value = ReadSerializable((IXmlSerializable)ReflectionCreateObject(sm.TypeDesc!.
Type
!)!, isWrappedAny);
1111
value = ReadSerializable((IXmlSerializable)ReflectionCreateObject(derived.TypeDesc!.
Type
!)!, isWrappedAny);
1234
Type collectionType = memberMapping.TypeDesc!.
Type
!;
1235
o = ReflectionCreateObject(memberMapping.TypeDesc.
Type
!);
1340
object? o = Activator.CreateInstance(nullableMapping.TypeDesc!.
Type
!);
1372
return Enum.ToObject(mapping.TypeDesc!.
Type
!, ToEnum(source, table, mapping.TypeDesc.Name));
1380
return Enum.Parse(mapping.TypeDesc!.
Type
!, c.Name);
1384
throw CreateUnknownConstantException(source, mapping.TypeDesc!.
Type
!);
1443
object? o = ReflectionCreateObject(structMapping.TypeDesc.
Type
!);
1564
memberSource = ReflectionCreateObject(typeDesc.
Type
!);
1570
new XmlSerializationCollectionFixupCallback(GetCreateCollectionOfObjectsCallback(typeDesc.
Type
!)),
1625
return ReflectionCreateObject(structMapping.TypeDesc.
Type
!);
1669
if (structMapping.TypeDesc.
Type
!= null && typeof(XmlSchemaObject).IsAssignableFrom(structMapping.TypeDesc.
Type
))
1674
object? o = ReflectionCreateObject(structMapping.TypeDesc.
Type
!)!;
1773
var addMethod = mapping.TypeDesc.
Type
!.GetMethod("Add");
1823
var empty = ReflectionCreateObject(mapping.TypeDesc.
Type
!);
1854
object choiceValue = Enum.Parse(choice.Mapping!.TypeDesc!.
Type
!, memberIds[elementIndex]);
1907
AddObjectsIntoTargetCollection(existingCollection, member.Collection, member.Mapping.TypeDesc!.
Type
!);
1913
SetCollectionObjectWithCollectionMember(ref collection, member.Collection, member.Mapping.TypeDesc!.
Type
!);
2130
Array arrayValue = Array.CreateInstance(member.Mapping.TypeDesc!.
Type
!.GetElementType()!, vals.Length);
System\Xml\Serialization\ReflectionXmlSerializationWriter.cs (12)
50
mapping.TypeDesc.
Type
!,
105
if (!mapping.TypeDesc!.IsValueType && !mapping.TypeDesc.
Type
!.IsPrimitive)
257
if (o != null && !td.
Type
!.IsAssignableFrom(o!.GetType()))
270
if (td.
Type
!.IsAssignableFrom(o!.GetType()))
444
WritePotentiallyReferencingElement(name, ns, o, mapping.TypeDesc!.
Type
, true, element.IsNullable);
517
WritePotentiallyReferencingElement(name, ns, o, !writeAccessor ? mapping.TypeDesc!.
Type
: null, !writeAccessor, element.IsNullable);
614
&& o.GetType() != mapping.TypeDesc!.
Type
)
638
if (mapping.TypeDesc.
Type
!= null && typeof(XmlSchemaObject).IsAssignableFrom(mapping.TypeDesc.
Type
))
756
if (m is EnumMapping em && em.TypeDesc!.
Type
== objType)
765
if (m is ArrayMapping am && am.TypeDesc!.
Type
== objType)
1001
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)
806
if (typeDesc.
Type
!= null)
807
return typeDesc.
Type
;
1215
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)
910
if (pm.TypeDesc.
Type
== null)
920
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 (10)
3357
if (structMapping.TypeDesc.
Type
!= null && typeof(XmlSchemaObject).IsAssignableFrom(structMapping.TypeDesc.
Type
))
4799
if (element.Mapping.TypeDesc!.
Type
== typeof(TimeSpan) || element.Mapping.TypeDesc!.
Type
== typeof(DateTimeOffset)
4800
|| element.Mapping.TypeDesc!.
Type
== typeof(DateOnly) || element.Mapping.TypeDesc!.
Type
== typeof(TimeOnly))
4806
if (element.Mapping.TypeDesc!.
Type
== typeof(TimeSpan))
4810
else if (element.Mapping.TypeDesc!.
Type
== typeof(DateTimeOffset))
4814
else if (element.Mapping.TypeDesc!.
Type
== typeof(DateOnly))
4818
else if (element.Mapping.TypeDesc!.
Type
== typeof(TimeOnly))
System\Xml\Serialization\XmlSerializationReaderILGen.cs (72)
697
ReflectionAwareILGen.ILGenForCreateInstance(ilg, mappings[i].TypeDesc!.
Type
!, false, false);
698
ilg.ConvertValue(mappings[i].TypeDesc!.
Type
!, typeof(object));
767
mapping.TypeDesc!.
Type
,
1069
ilg.Ldc(Enum.ToObject(mapping.TypeDesc!.
Type
!, constants[i].Value));
1070
ilg.ConvertValue(mapping.TypeDesc.
Type
!, typeof(long));
1105
returnType = mapping.TypeDesc.
Type
!;
1172
retValues.Add(Enum.ToObject(mapping.TypeDesc.
Type
!, c.Value));
1195
ilg.Ldc(mapping.TypeDesc.
Type
!);
1234
derived.TypeDesc.
Type
,
1279
enumMapping.TypeDesc!.
Type
,
1329
LocalBuilder aLoc = ilg.DeclareLocal(arrayMapping.TypeDesc.
Type
!, aVar);
1332
ReflectionAwareILGen.ILGenForCreateInstance(ilg, td.
Type
!, false, false);
1356
nullableMapping.TypeDesc!.
Type
!,
1362
LocalBuilder oLoc = ilg.DeclareLocal(nullableMapping.TypeDesc.
Type
!, "o");
1365
ilg.InitObj(nullableMapping.TypeDesc.
Type
!);
1416
structMapping.TypeDesc.
Type
!,
1587
if (structMapping.TypeDesc.
Type
!= null && typeof(XmlSchemaObject).IsAssignableFrom(structMapping.TypeDesc.
Type
))
1762
ilg.Ldloc(structMapping.TypeDesc.
Type
!, "o");
1975
ConstructorInfo ctor = xmlnsMember.Mapping.TypeDesc!.
Type
!.GetConstructor(
1980
WriteSourceEnd(xmlnsMember.Source, xmlnsMember.Mapping.TypeDesc.
Type
!);
1985
MethodInfo Add = xmlnsMember.Mapping.TypeDesc.
Type
!.GetMethod(
1995
ILGenLoad(xmlnsMember.ArraySource, xmlnsMember.Mapping.TypeDesc.
Type
);
2117
WriteSourceEnd(member.ArraySource, member.Mapping.TypeDesc!.IsArrayLike ? member.Mapping.TypeDesc.ArrayElementTypeDesc!.
Type
! : member.Mapping.TypeDesc.
Type
!);
2135
WriteSourceEnd(member.ArraySource, member.Mapping.TypeDesc!.IsArrayLike ? member.Mapping.TypeDesc.ArrayElementTypeDesc!.
Type
! : member.Mapping.TypeDesc.
Type
!);
2178
WriteSourceEnd(attributeSource, member.Mapping.TypeDesc!.ArrayElementTypeDesc!.
Type
!);
2185
WriteSourceEnd(member.ArraySource, member.Mapping.TypeDesc!.IsArrayLike ? member.Mapping.TypeDesc.ArrayElementTypeDesc!.
Type
! : member.Mapping.TypeDesc.
Type
!);
2231
WriteCreateInstance(a, typeDesc.CannotNew, typeDesc.
Type
!);
2234
WriteSourceEnd(member.Source, typeDesc.
Type
!);
2259
ReflectionAwareILGen.ILGenForCreateInstance(ilg, member.Mapping.TypeDesc.
Type
!, typeDesc.CannotNew, true);
2260
WriteSourceEnd(member.Source, member.Mapping.TypeDesc.
Type
!);
2264
WriteLocalDecl(a, new SourceInfo(member.Source, member.Source, member.Mapping.MemberInfo, member.Mapping.TypeDesc.
Type
, ilg));
2430
WriteSourceEnd(member.ArraySource, special.TypeDesc.
Type
!);
2468
WriteSourceEnd(member.ArraySource, text.Mapping!.TypeDesc!.
Type
!);
2531
WriteSourceEnd(member.ArraySource, text.Mapping.TypeDesc.
Type
!);
2760
ilg.Ldc(typeDesc.ArrayElementTypeDesc!.
Type
!);
2763
ilg.ConvertValue(XmlSerializationReader_ShrinkArray.ReturnType, typeDesc.
Type
!);
2764
WriteSourceEnd(member.Source, typeDesc.
Type
!);
2775
ilg.Ldc(member.Mapping.ChoiceIdentifier.Mapping!.TypeDesc!.
Type
!);
2778
ilg.ConvertValue(XmlSerializationReader_ShrinkArray.ReturnType, member.Mapping.ChoiceIdentifier.Mapping.TypeDesc.
Type
!.MakeArrayType());
2779
WriteSourceEnd(member.ChoiceSource!, member.Mapping.ChoiceIdentifier.Mapping.TypeDesc.
Type
!.MakeArrayType());
3198
element.Mapping.TypeDesc!.
Type
,
3202
WriteSourceEnd(source, element.Mapping.TypeDesc.
Type
!);
3230
WriteSourceEnd(source, element.Mapping.TypeDesc.
Type
!);
3265
if ((element.Mapping.TypeDesc!.
Type
== typeof(TimeSpan)) || element.Mapping.TypeDesc!.
Type
== typeof(DateTimeOffset)
3266
|| element.Mapping.TypeDesc!.
Type
== typeof(DateOnly) || element.Mapping.TypeDesc!.
Type
== typeof(TimeOnly))
3291
LocalBuilder tmpLoc = ilg.GetTempLocal(element.Mapping.TypeDesc!.
Type
);
3293
ilg.InitObj(element.Mapping.TypeDesc!.
Type
);
3295
WriteSourceEnd(source, element.Mapping.TypeDesc.
Type
);
3299
WriteSourceEnd(source, element.Mapping.TypeDesc.
Type
);
3331
WriteSourceEnd(source, element.Mapping.TypeDesc.
Type
!);
3379
mapping.TypeDesc.
Type
,
3383
WriteSourceEnd(source, mapping.TypeDesc.
Type
!);
3405
ilg.Castclass(special.TypeDesc.
Type
!);
3406
WriteSourceEnd(source, special.TypeDesc!.
Type
!);
3444
ReflectionAwareILGen.ILGenForCreateInstance(ilg, sm.TypeDesc!.
Type
!, sm.TypeDesc.CannotNew, false);
3448
ilg.ConvertValue(sm.TypeDesc.
Type
!, typeof(IXmlSerializable));
3454
ilg.ConvertValue(typeof(IXmlSerializable), sm.TypeDesc.
Type
!);
3455
WriteSourceEnd(source, sm.TypeDesc!.
Type
!);
3479
ReflectionAwareILGen.ILGenForEnumMember(ilg, choice.Mapping!.TypeDesc!.
Type
!, choice.MemberIds[elementIndex]);
3480
WriteSourceEnd(choiceSource!, choice.Mapping.TypeDesc.
Type
!);
3517
ReflectionAwareILGen.ILGenForCreateInstance(ilg, derived.TypeDesc!.
Type
!, derived.TypeDesc.CannotNew, false);
3525
ilg.ConvertValue(typeof(IXmlSerializable), head.TypeDesc.
Type
!);
3526
WriteSourceEnd(source, head.TypeDesc!.
Type
!);
3651
mapping.TypeDesc.
Type
!,
3658
ReflectionAwareILGen.ILGenForCreateInstance(ilg, mapping.TypeDesc.
Type
!, mapping.TypeDesc.CannotNew, true);
3697
ReflectionAwareILGen.WriteArrayLocalDecl(typeName, variableName, new SourceInfo(initValue, initValue, null, arrayTypeDesc.
Type
, ilg), arrayTypeDesc);
System\Xml\Serialization\XmlSerializationWriter.cs (5)
2887
if (!mapping.IsSoap && !mapping.TypeDesc!.IsValueType && !mapping.TypeDesc.
Type
!.IsPrimitive)
3190
if (mapping.TypeDesc.
Type
!= null && typeof(XmlSchemaObject).IsAssignableFrom(mapping.TypeDesc.
Type
))
4281
Type? type = Type.GetType(mapping.TypeDesc!.
Type
!.FullName!);
4289
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);
1498
ilg.ConvertValue(arrayTypeDesc.
Type
!, typeIEnumerable);
1502
Type typeIEnumerable = typeof(IEnumerable<>).MakeGenericType(arrayElementTypeDesc.
Type
!);
1509
ilg.ConvertValue(arrayTypeDesc.
Type
!, typeIEnumerable);
1513
getEnumeratorMethod = arrayTypeDesc.
Type
!.GetMethod(
1535
WriteLocalDecl(arrayNamePlusI, "e.Current", arrayElementTypeDesc.
Type
!);
1545
WriteElements(new SourceInfo(arrayNamePlusI, null, null, arrayElementTypeDesc.
Type
, ilg), $"{choiceName}i", elements, text, choice, arrayNamePlusA, true, true);
1570
WriteLocalDecl(arrayNamePlusI, ReflectionAwareILGen.GetStringForArrayMember(arrayName, iPlusArrayName), arrayElementTypeDesc.
Type
!);
1573
WriteLocalDecl($"{choiceName}i", ReflectionAwareILGen.GetStringForArrayMember(choiceName, iPlusArrayName), choice.Mapping!.TypeDesc!.
Type
!);
1575
WriteElements(new SourceInfo(arrayNamePlusI, null, null, arrayElementTypeDesc.
Type
, ilg), $"{choiceName}i", elements, text, choice, arrayNamePlusA, true, arrayElementTypeDesc.IsNullable);
1587
WriteElements(new SourceInfo(ReflectionAwareILGen.GetStringForArrayMember(arrayName, iPlusArrayName), null, null, arrayElementTypeDesc.
Type
, ilg), null, elements, text, choice, arrayNamePlusA, true, arrayElementTypeDesc.IsNullable);
1656
ILGenLoad(enumSource!, choice == null ? null : choice.Mapping!.TypeDesc!.
Type
);
1684
WriteInstanceOf(source, td.
Type
!);
1733
ILGenLoad(enumSource!, choice == null ? null : choice.Mapping!.TypeDesc!.
Type
);
1850
WriteInstanceOf(source, text.Mapping!.TypeDesc!.
Type
!);
1945
if (source.Type == element.Mapping.TypeDesc!.
Type
)
1947
MethodInfo Nullable_get_HasValue = element.Mapping.TypeDesc.
Type
!.GetMethod(
1952
source.LoadAddress(element.Mapping.TypeDesc.
Type
);
2045
source.Load(structMapping.TypeDesc!.
Type
);
2046
argTypes.Add(structMapping.TypeDesc.
Type
!);
2201
WriteInstanceOf(source, typeDesc.
Type
!);
2296
eValue = Enum.ToObject(choiceMapping.TypeDesc!.
Type
!, choiceMapping.Constants[i].Value);
2310
eValue = Enum.ToObject(choiceMapping.TypeDesc!.
Type
!, choiceMapping.Constants[i].Value);
2380
return new SourceInfo(GetStringForMember(obj, member.Name), obj, memberInfo, member.TypeDesc!.
Type
, ilg);
2593
Type localType = (typeName == arrayTypeDesc.CSharpName) ? arrayTypeDesc.
Type
! : arrayTypeDesc.
Type
!.MakeArrayType();