206 references to Type
System.Private.Xml (206)
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!; 919value = ReflectionCreateObject(element.Mapping.TypeDesc.Type!); 931else if (element.Mapping.TypeDesc!.Type == typeof(TimeSpan) && Reader.IsEmptyElement) 936else if (element.Mapping.TypeDesc!.Type == typeof(DateTimeOffset) && Reader.IsEmptyElement) 941else if (element.Mapping.TypeDesc!.Type == typeof(DateOnly) && Reader.IsEmptyElement) 946else if (element.Mapping.TypeDesc!.Type == typeof(TimeOnly) && Reader.IsEmptyElement) 1044value = ReadSerializable((IXmlSerializable)ReflectionCreateObject(sm.TypeDesc!.Type!)!, isWrappedAny); 1065value = ReadSerializable((IXmlSerializable)ReflectionCreateObject(sm.TypeDesc!.Type!)!, isWrappedAny); 1111value = ReadSerializable((IXmlSerializable)ReflectionCreateObject(derived.TypeDesc!.Type!)!, isWrappedAny); 1234Type collectionType = memberMapping.TypeDesc!.Type!; 1235o = ReflectionCreateObject(memberMapping.TypeDesc.Type!); 1340object? o = Activator.CreateInstance(nullableMapping.TypeDesc!.Type!); 1372return Enum.ToObject(mapping.TypeDesc!.Type!, ToEnum(source, table, mapping.TypeDesc.Name)); 1380return Enum.Parse(mapping.TypeDesc!.Type!, c.Name); 1384throw CreateUnknownConstantException(source, mapping.TypeDesc!.Type!); 1443object? o = ReflectionCreateObject(structMapping.TypeDesc.Type!); 1564memberSource = ReflectionCreateObject(typeDesc.Type!); 1570new XmlSerializationCollectionFixupCallback(GetCreateCollectionOfObjectsCallback(typeDesc.Type!)), 1625return ReflectionCreateObject(structMapping.TypeDesc.Type!); 1669if (structMapping.TypeDesc.Type != null && typeof(XmlSchemaObject).IsAssignableFrom(structMapping.TypeDesc.Type)) 1674object? o = ReflectionCreateObject(structMapping.TypeDesc.Type!)!; 1773var addMethod = mapping.TypeDesc.Type!.GetMethod("Add"); 1823var empty = ReflectionCreateObject(mapping.TypeDesc.Type!); 1854object choiceValue = Enum.Parse(choice.Mapping!.TypeDesc!.Type!, memberIds[elementIndex]); 1907AddObjectsIntoTargetCollection(existingCollection, member.Collection, member.Mapping.TypeDesc!.Type!); 1913SetCollectionObjectWithCollectionMember(ref collection, member.Collection, member.Mapping.TypeDesc!.Type!); 2130Array arrayValue = Array.CreateInstance(member.Mapping.TypeDesc!.Type!.GetElementType()!, vals.Length);
System\Xml\Serialization\ReflectionXmlSerializationWriter.cs (12)
50mapping.TypeDesc.Type!, 105if (!mapping.TypeDesc!.IsValueType && !mapping.TypeDesc.Type!.IsPrimitive) 257if (o != null && !td.Type!.IsAssignableFrom(o!.GetType())) 270if (td.Type!.IsAssignableFrom(o!.GetType())) 444WritePotentiallyReferencingElement(name, ns, o, mapping.TypeDesc!.Type, true, element.IsNullable); 517WritePotentiallyReferencingElement(name, ns, o, !writeAccessor ? mapping.TypeDesc!.Type : null, !writeAccessor, element.IsNullable); 614&& o.GetType() != mapping.TypeDesc!.Type) 638if (mapping.TypeDesc.Type != null && typeof(XmlSchemaObject).IsAssignableFrom(mapping.TypeDesc.Type)) 756if (m is EnumMapping em && em.TypeDesc!.Type == objType) 765if (m is ArrayMapping am && am.TypeDesc!.Type == objType) 1001if (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)
3357if (structMapping.TypeDesc.Type != null && typeof(XmlSchemaObject).IsAssignableFrom(structMapping.TypeDesc.Type)) 4799if (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)) 4806if (element.Mapping.TypeDesc!.Type == typeof(TimeSpan)) 4810else if (element.Mapping.TypeDesc!.Type == typeof(DateTimeOffset)) 4814else if (element.Mapping.TypeDesc!.Type == typeof(DateOnly)) 4818else 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()); 3198element.Mapping.TypeDesc!.Type, 3202WriteSourceEnd(source, element.Mapping.TypeDesc.Type!); 3230WriteSourceEnd(source, element.Mapping.TypeDesc.Type!); 3265if ((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)) 3291LocalBuilder tmpLoc = ilg.GetTempLocal(element.Mapping.TypeDesc!.Type); 3293ilg.InitObj(element.Mapping.TypeDesc!.Type); 3295WriteSourceEnd(source, element.Mapping.TypeDesc.Type); 3299WriteSourceEnd(source, element.Mapping.TypeDesc.Type); 3331WriteSourceEnd(source, element.Mapping.TypeDesc.Type!); 3379mapping.TypeDesc.Type, 3383WriteSourceEnd(source, mapping.TypeDesc.Type!); 3405ilg.Castclass(special.TypeDesc.Type!); 3406WriteSourceEnd(source, special.TypeDesc!.Type!); 3444ReflectionAwareILGen.ILGenForCreateInstance(ilg, sm.TypeDesc!.Type!, sm.TypeDesc.CannotNew, false); 3448ilg.ConvertValue(sm.TypeDesc.Type!, typeof(IXmlSerializable)); 3454ilg.ConvertValue(typeof(IXmlSerializable), sm.TypeDesc.Type!); 3455WriteSourceEnd(source, sm.TypeDesc!.Type!); 3479ReflectionAwareILGen.ILGenForEnumMember(ilg, choice.Mapping!.TypeDesc!.Type!, choice.MemberIds[elementIndex]); 3480WriteSourceEnd(choiceSource!, choice.Mapping.TypeDesc.Type!); 3517ReflectionAwareILGen.ILGenForCreateInstance(ilg, derived.TypeDesc!.Type!, derived.TypeDesc.CannotNew, false); 3525ilg.ConvertValue(typeof(IXmlSerializable), head.TypeDesc.Type!); 3526WriteSourceEnd(source, head.TypeDesc!.Type!); 3651mapping.TypeDesc.Type!, 3658ReflectionAwareILGen.ILGenForCreateInstance(ilg, mapping.TypeDesc.Type!, mapping.TypeDesc.CannotNew, true); 3697ReflectionAwareILGen.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();