207 references to Type
System.Private.Xml (207)
System\Xml\Serialization\Compilation.cs (1)
500VerifyLoadContext(mapping.Accessor.Mapping?.TypeDesc?.Type, contextAssembly);
System\Xml\Serialization\ReflectionXmlSerializationReader.cs (33)
52mapping.TypeDesc.Type!, 283SetCollectionObjectWithCollectionMember(ref value, member.Collection!, member.Mapping.TypeDesc!.Type!); 290SetCollectionObjectWithCollectionMember(ref value, anyAttribute.Collection!, anyAttribute.Mapping.TypeDesc!.Type!); 311p[i] = ReflectionCreateObject(mappings[i].TypeDesc!.Type!); 807elementType = td.Type!; 811elementType = ele.Mapping!.TypeDesc!.Type!; 918value = ReflectionCreateObject(element.Mapping.TypeDesc.Type!); 934else if (element.Mapping.TypeDesc!.Type == typeof(TimeSpan) && Reader.IsEmptyElement) 939else if (element.Mapping.TypeDesc!.Type == typeof(DateTimeOffset) && Reader.IsEmptyElement) 944else if (element.Mapping.TypeDesc!.Type == typeof(DateOnly) && Reader.IsEmptyElement) 949else if (element.Mapping.TypeDesc!.Type == typeof(TimeOnly) && Reader.IsEmptyElement) 1048value = ReadSerializable((IXmlSerializable)ReflectionCreateObject(sm.TypeDesc!.Type!)!, isWrappedAny); 1069value = ReadSerializable((IXmlSerializable)ReflectionCreateObject(sm.TypeDesc!.Type!)!, isWrappedAny); 1115value = ReadSerializable((IXmlSerializable)ReflectionCreateObject(derived.TypeDesc!.Type!)!, isWrappedAny); 1239Type collectionType = memberMapping.TypeDesc!.Type!; 1240o = ReflectionCreateObject(memberMapping.TypeDesc.Type!); 1345object? o = Activator.CreateInstance(nullableMapping.TypeDesc!.Type!); 1377return Enum.ToObject(mapping.TypeDesc!.Type!, ToEnum(source, table, mapping.TypeDesc.Name)); 1385return Enum.Parse(mapping.TypeDesc!.Type!, c.Name); 1389throw CreateUnknownConstantException(source, mapping.TypeDesc!.Type!); 1448object? o = ReflectionCreateObject(structMapping.TypeDesc.Type!); 1569memberSource = ReflectionCreateObject(typeDesc.Type!); 1575new XmlSerializationCollectionFixupCallback(GetCreateCollectionOfObjectsCallback(typeDesc.Type!)), 1630return ReflectionCreateObject(structMapping.TypeDesc.Type!); 1674if (structMapping.TypeDesc.Type != null && typeof(XmlSchemaObject).IsAssignableFrom(structMapping.TypeDesc.Type)) 1679object? o = ReflectionCreateObject(structMapping.TypeDesc.Type!)!; 1778var addMethod = mapping.TypeDesc.Type!.GetMethod("Add"); 1828var empty = ReflectionCreateObject(mapping.TypeDesc.Type!); 1859object choiceValue = Enum.Parse(choice.Mapping!.TypeDesc!.Type!, memberIds[elementIndex]); 1912AddObjectsIntoTargetCollection(existingCollection, member.Collection, member.Mapping.TypeDesc!.Type!); 1918SetCollectionObjectWithCollectionMember(ref collection, member.Collection, member.Mapping.TypeDesc!.Type!); 2134Array arrayValue = Array.CreateInstance(member.Mapping.TypeDesc!.Type!.GetElementType()!, vals.Length);
System\Xml\Serialization\ReflectionXmlSerializationWriter.cs (13)
51mapping.TypeDesc.Type!, 106if (!mapping.TypeDesc!.IsValueType && !mapping.TypeDesc.Type!.IsPrimitive) 229Type? elementType = mapping.TypeDesc!.Type; 396if (o != null && !td.Type!.IsAssignableFrom(o!.GetType())) 409if (td.Type!.IsAssignableFrom(o!.GetType())) 583WritePotentiallyReferencingElement(name, ns, o, mapping.TypeDesc!.Type, true, element.IsNullable); 656WritePotentiallyReferencingElement(name, ns, o, !writeAccessor ? mapping.TypeDesc!.Type : null, !writeAccessor, element.IsNullable); 753&& o.GetType() != mapping.TypeDesc!.Type) 777if (mapping.TypeDesc.Type != null && typeof(XmlSchemaObject).IsAssignableFrom(mapping.TypeDesc.Type)) 895if (m is EnumMapping em && em.TypeDesc!.Type == objType) 904if (m is ArrayMapping am && am.TypeDesc!.Type == objType) 1140if (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)
806if (typeDesc.Type != null) 807return typeDesc.Type; 1215if (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)
910if (pm.TypeDesc.Type == null) 920System.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 (10)
3360if (structMapping.TypeDesc.Type != null && typeof(XmlSchemaObject).IsAssignableFrom(structMapping.TypeDesc.Type)) 4804if (element.Mapping.TypeDesc!.Type == typeof(TimeSpan) || element.Mapping.TypeDesc!.Type == typeof(DateTimeOffset) 4805|| element.Mapping.TypeDesc!.Type == typeof(DateOnly) || element.Mapping.TypeDesc!.Type == typeof(TimeOnly)) 4811if (element.Mapping.TypeDesc!.Type == typeof(TimeSpan)) 4815else if (element.Mapping.TypeDesc!.Type == typeof(DateTimeOffset)) 4819else if (element.Mapping.TypeDesc!.Type == typeof(DateOnly)) 4823else if (element.Mapping.TypeDesc!.Type == typeof(TimeOnly))
System\Xml\Serialization\XmlSerializationReaderILGen.cs (72)
697ReflectionAwareILGen.ILGenForCreateInstance(ilg, mappings[i].TypeDesc!.Type!, false, false); 698ilg.ConvertValue(mappings[i].TypeDesc!.Type!, typeof(object)); 767mapping.TypeDesc!.Type, 1069ilg.Ldc(Enum.ToObject(mapping.TypeDesc!.Type!, constants[i].Value)); 1070ilg.ConvertValue(mapping.TypeDesc.Type!, typeof(long)); 1105returnType = mapping.TypeDesc.Type!; 1172retValues.Add(Enum.ToObject(mapping.TypeDesc.Type!, c.Value)); 1195ilg.Ldc(mapping.TypeDesc.Type!); 1234derived.TypeDesc.Type, 1279enumMapping.TypeDesc!.Type, 1329LocalBuilder aLoc = ilg.DeclareLocal(arrayMapping.TypeDesc.Type!, aVar); 1332ReflectionAwareILGen.ILGenForCreateInstance(ilg, td.Type!, false, false); 1356nullableMapping.TypeDesc!.Type!, 1362LocalBuilder oLoc = ilg.DeclareLocal(nullableMapping.TypeDesc.Type!, "o"); 1365ilg.InitObj(nullableMapping.TypeDesc.Type!); 1416structMapping.TypeDesc.Type!, 1587if (structMapping.TypeDesc.Type != null && typeof(XmlSchemaObject).IsAssignableFrom(structMapping.TypeDesc.Type)) 1762ilg.Ldloc(structMapping.TypeDesc.Type!, "o"); 1975ConstructorInfo ctor = xmlnsMember.Mapping.TypeDesc!.Type!.GetConstructor( 1980WriteSourceEnd(xmlnsMember.Source, xmlnsMember.Mapping.TypeDesc.Type!); 1985MethodInfo Add = xmlnsMember.Mapping.TypeDesc.Type!.GetMethod( 1995ILGenLoad(xmlnsMember.ArraySource, xmlnsMember.Mapping.TypeDesc.Type); 2117WriteSourceEnd(member.ArraySource, member.Mapping.TypeDesc!.IsArrayLike ? member.Mapping.TypeDesc.ArrayElementTypeDesc!.Type! : member.Mapping.TypeDesc.Type!); 2135WriteSourceEnd(member.ArraySource, member.Mapping.TypeDesc!.IsArrayLike ? member.Mapping.TypeDesc.ArrayElementTypeDesc!.Type! : member.Mapping.TypeDesc.Type!); 2178WriteSourceEnd(attributeSource, member.Mapping.TypeDesc!.ArrayElementTypeDesc!.Type!); 2185WriteSourceEnd(member.ArraySource, member.Mapping.TypeDesc!.IsArrayLike ? member.Mapping.TypeDesc.ArrayElementTypeDesc!.Type! : member.Mapping.TypeDesc.Type!); 2231WriteCreateInstance(a, typeDesc.CannotNew, typeDesc.Type!); 2234WriteSourceEnd(member.Source, typeDesc.Type!); 2259ReflectionAwareILGen.ILGenForCreateInstance(ilg, member.Mapping.TypeDesc.Type!, typeDesc.CannotNew, true); 2260WriteSourceEnd(member.Source, member.Mapping.TypeDesc.Type!); 2264WriteLocalDecl(a, new SourceInfo(member.Source, member.Source, member.Mapping.MemberInfo, member.Mapping.TypeDesc.Type, ilg)); 2430WriteSourceEnd(member.ArraySource, special.TypeDesc.Type!); 2468WriteSourceEnd(member.ArraySource, text.Mapping!.TypeDesc!.Type!); 2531WriteSourceEnd(member.ArraySource, text.Mapping.TypeDesc.Type!); 2760ilg.Ldc(typeDesc.ArrayElementTypeDesc!.Type!); 2763ilg.ConvertValue(XmlSerializationReader_ShrinkArray.ReturnType, typeDesc.Type!); 2764WriteSourceEnd(member.Source, typeDesc.Type!); 2775ilg.Ldc(member.Mapping.ChoiceIdentifier.Mapping!.TypeDesc!.Type!); 2778ilg.ConvertValue(XmlSerializationReader_ShrinkArray.ReturnType, member.Mapping.ChoiceIdentifier.Mapping.TypeDesc.Type!.MakeArrayType()); 2779WriteSourceEnd(member.ChoiceSource!, member.Mapping.ChoiceIdentifier.Mapping.TypeDesc.Type!.MakeArrayType()); 3194element.Mapping.TypeDesc!.Type, 3198WriteSourceEnd(source, element.Mapping.TypeDesc.Type!); 3222WriteSourceEnd(source, element.Mapping.TypeDesc.Type!); 3261if ((element.Mapping.TypeDesc!.Type == typeof(TimeSpan)) || element.Mapping.TypeDesc!.Type == typeof(DateTimeOffset) 3262|| element.Mapping.TypeDesc!.Type == typeof(DateOnly) || element.Mapping.TypeDesc!.Type == typeof(TimeOnly)) 3287LocalBuilder tmpLoc = ilg.GetTempLocal(element.Mapping.TypeDesc!.Type); 3289ilg.InitObj(element.Mapping.TypeDesc!.Type); 3291WriteSourceEnd(source, element.Mapping.TypeDesc.Type); 3295WriteSourceEnd(source, element.Mapping.TypeDesc.Type); 3327WriteSourceEnd(source, element.Mapping.TypeDesc.Type!); 3375mapping.TypeDesc.Type, 3379WriteSourceEnd(source, mapping.TypeDesc.Type!); 3401ilg.Castclass(special.TypeDesc.Type!); 3402WriteSourceEnd(source, special.TypeDesc!.Type!); 3440ReflectionAwareILGen.ILGenForCreateInstance(ilg, sm.TypeDesc!.Type!, sm.TypeDesc.CannotNew, false); 3444ilg.ConvertValue(sm.TypeDesc.Type!, typeof(IXmlSerializable)); 3450ilg.ConvertValue(typeof(IXmlSerializable), sm.TypeDesc.Type!); 3451WriteSourceEnd(source, sm.TypeDesc!.Type!); 3475ReflectionAwareILGen.ILGenForEnumMember(ilg, choice.Mapping!.TypeDesc!.Type!, choice.MemberIds[elementIndex]); 3476WriteSourceEnd(choiceSource!, choice.Mapping.TypeDesc.Type!); 3513ReflectionAwareILGen.ILGenForCreateInstance(ilg, derived.TypeDesc!.Type!, derived.TypeDesc.CannotNew, false); 3521ilg.ConvertValue(typeof(IXmlSerializable), head.TypeDesc.Type!); 3522WriteSourceEnd(source, head.TypeDesc!.Type!); 3647mapping.TypeDesc.Type!, 3654ReflectionAwareILGen.ILGenForCreateInstance(ilg, mapping.TypeDesc.Type!, mapping.TypeDesc.CannotNew, true); 3693ReflectionAwareILGen.WriteArrayLocalDecl(typeName, variableName, new SourceInfo(initValue, initValue, null, arrayTypeDesc.Type, ilg), arrayTypeDesc);
System\Xml\Serialization\XmlSerializationWriter.cs (5)
2887if (!mapping.IsSoap && !mapping.TypeDesc!.IsValueType && !mapping.TypeDesc.Type!.IsPrimitive) 3190if (mapping.TypeDesc.Type != null && typeof(XmlSchemaObject).IsAssignableFrom(mapping.TypeDesc.Type)) 4281Type? type = Type.GetType(mapping.TypeDesc!.Type!.FullName!); 4289Type? 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); 1498ilg.ConvertValue(arrayTypeDesc.Type!, typeIEnumerable); 1502Type typeIEnumerable = typeof(IEnumerable<>).MakeGenericType(arrayElementTypeDesc.Type!); 1509ilg.ConvertValue(arrayTypeDesc.Type!, typeIEnumerable); 1513getEnumeratorMethod = arrayTypeDesc.Type!.GetMethod( 1535WriteLocalDecl(arrayNamePlusI, "e.Current", arrayElementTypeDesc.Type!); 1545WriteElements(new SourceInfo(arrayNamePlusI, null, null, arrayElementTypeDesc.Type, ilg), $"{choiceName}i", elements, text, choice, arrayNamePlusA, true, true); 1570WriteLocalDecl(arrayNamePlusI, ReflectionAwareILGen.GetStringForArrayMember(arrayName, iPlusArrayName), arrayElementTypeDesc.Type!); 1573WriteLocalDecl($"{choiceName}i", ReflectionAwareILGen.GetStringForArrayMember(choiceName, iPlusArrayName), choice.Mapping!.TypeDesc!.Type!); 1575WriteElements(new SourceInfo(arrayNamePlusI, null, null, arrayElementTypeDesc.Type, ilg), $"{choiceName}i", elements, text, choice, arrayNamePlusA, true, arrayElementTypeDesc.IsNullable); 1587WriteElements(new SourceInfo(ReflectionAwareILGen.GetStringForArrayMember(arrayName, iPlusArrayName), null, null, arrayElementTypeDesc.Type, ilg), null, elements, text, choice, arrayNamePlusA, true, arrayElementTypeDesc.IsNullable); 1656ILGenLoad(enumSource!, choice == null ? null : choice.Mapping!.TypeDesc!.Type); 1684WriteInstanceOf(source, td.Type!); 1733ILGenLoad(enumSource!, choice == null ? null : choice.Mapping!.TypeDesc!.Type); 1850WriteInstanceOf(source, text.Mapping!.TypeDesc!.Type!); 1945if (source.Type == element.Mapping.TypeDesc!.Type) 1947MethodInfo Nullable_get_HasValue = element.Mapping.TypeDesc.Type!.GetMethod( 1952source.LoadAddress(element.Mapping.TypeDesc.Type); 2045source.Load(structMapping.TypeDesc!.Type); 2046argTypes.Add(structMapping.TypeDesc.Type!); 2201WriteInstanceOf(source, typeDesc.Type!); 2296eValue = Enum.ToObject(choiceMapping.TypeDesc!.Type!, choiceMapping.Constants[i].Value); 2310eValue = Enum.ToObject(choiceMapping.TypeDesc!.Type!, choiceMapping.Constants[i].Value); 2380return new SourceInfo(GetStringForMember(obj, member.Name), obj, memberInfo, member.TypeDesc!.Type, ilg); 2593Type localType = (typeName == arrayTypeDesc.CSharpName) ? arrayTypeDesc.Type! : arrayTypeDesc.Type!.MakeArrayType();