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