55 writes to TypeDesc
dotnet-svcutil-lib (55)
FrameworkFork\Microsoft.Xml\Xml\Serialization\SchemaImporter.cs (1)
184mapping.TypeDesc = typeDesc;
FrameworkFork\Microsoft.Xml\Xml\Serialization\SoapReflectionImporter.cs (9)
261mapping.TypeDesc = typeDesc; 316mapping.TypeDesc = typeDesc; 342mapping.TypeDesc = model.TypeDesc; 457mapping.TypeDesc = model.TypeDesc; 564mapping.TypeDesc = _typeScope.GetTypeDesc(dataType, XmlSchema.Namespace); 568mapping.TypeDesc = _typeScope.GetTypeDesc(dataType, UrtTypes.Namespace); 577mapping.TypeDesc = model.TypeDesc; 598mapping.TypeDesc = model.TypeDesc; 638members.TypeDesc = _typeScope.GetTypeDesc(typeof(object[]));
FrameworkFork\Microsoft.Xml\Xml\Serialization\SoapSchemaImporter.cs (12)
88mapping.TypeDesc = Scope.GetTypeDesc(typeof(object[])); 141mapping.TypeDesc = Scope.GetTypeDesc(typeof(object[])); 327structMapping.TypeDesc = new TypeDesc(typeName, typeName, TypeKind.Struct, baseTypeDesc, flags); 461arrayMapping.TypeDesc = itemAccessor.Mapping.TypeDesc.CreateArrayTypeDesc(); 506mapping.TypeDesc = td; 522arrayMapping.TypeDesc = itemAccessor.Mapping.TypeDesc.CreateArrayTypeDesc(); 540arrayMapping.TypeDesc = ((TypeMapping)itemAccessor.Mapping).TypeDesc.CreateArrayTypeDesc(); 610mapping.TypeDesc = Scope.GetTypeDesc(typeof(string)); 631enumMapping.TypeDesc = new TypeDesc(typeName, typeName, TypeKind.Enum, null, 0); 658mapping.TypeDesc = Scope.GetTypeDesc(typeof(string)); 672mapping.TypeDesc = sourceTypeDesc; 687mapping.TypeDesc = typeDesc;
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlReflectionImporter.cs (12)
554serializableMapping.TypeDesc = typeDesc; 562serializableMapping.TypeDesc = typeDesc; 570mapping.TypeDesc = typeDesc; 640mapping.TypeDesc = typeDesc; 685mapping.TypeDesc = typeDesc; 745mapping.TypeDesc = model.TypeDesc; 1092mapping.TypeDesc = model.TypeDesc; 1162mapping.TypeDesc = _typeScope.GetTypeDesc(dataType, XmlSchema.Namespace); 1166mapping.TypeDesc = _typeScope.GetTypeDesc(dataType, UrtTypes.Namespace); 1175mapping.TypeDesc = model.TypeDesc; 1198mapping.TypeDesc = model.TypeDesc; 1245members.TypeDesc = _typeScope.GetTypeDesc(typeof(object[]));
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSchemaImporter.cs (21)
81mapping.TypeDesc = Scope.GetTypeDesc("string", XmlSchema.Namespace, flags); 268mapping.TypeDesc = Scope.GetTypeDesc(typeof(object[])); 469mapping.TypeDesc = mapping.TypeDesc.CreateMappedTypeDesc(new MappedTypeDesc(typeName, qname.Name, qname.Namespace, type, context, typeOwner, mainNamespace, compileUnit.ReferencedAssemblies)); 475top.TypeDesc = mapping.TypeDesc; 595mappings.TypeDesc = Scope.GetTypeDesc(typeof(object[])); 663structMapping.TypeDesc = new TypeDesc(typeName, typeName, TypeKind.Struct, baseTypeDesc, flags); 717structMapping.TypeDesc = new TypeDesc(typeName, typeName, TypeKind.Struct, baseTypeDesc, flags); 1283textMapping.TypeDesc = Scope.GetTypeDesc(typeof(XmlNode)); 1303mapping.TypeDesc = Scope.GetTypeDesc(makeElement ? typeof(XmlElement) : typeof(XmlNode)); 1397arrayMapping.TypeDesc = choiceMember.TypeDesc; 1415arrayMapping.TypeDesc = ((TypeMapping)itemAccessor.Mapping).TypeDesc.CreateArrayTypeDesc(); 1486mapping.TypeDesc = Scope.GetTypeDesc(typeof(XmlElement)); 1495mapping.TypeDesc = Scope.GetTypeDesc(mixed ? typeof(XmlNode) : typeof(XmlElement)); 1507mapping.TypeDesc = mapping.TypeDesc.CreateArrayTypeDesc(); 1595mapping.TypeDesc = Scope.GetTypeDesc(typeof(XmlAttribute)); 1656xmlnsMapping.TypeDesc = xmlnsTypeDesc; 1692mapping.TypeDesc = Scope.GetTypeDesc(typeof(string)); 1846enumMapping.TypeDesc = new TypeDesc(typeName, typeName, TypeKind.Enum, null, 0); 1902enumMapping.TypeDesc = new TypeDesc(typeName, typeName, TypeKind.Enum, null, 0); 1931mapping.TypeDesc = sourceTypeDesc; 1947mapping.TypeDesc = typeDesc;
448 references to TypeDesc
dotnet-svcutil-lib (448)
FrameworkFork\Microsoft.Xml\Xml\Serialization\CodeExporter.cs (7)
192include.Arguments.Add(new CodeAttributeArgument(new CodeTypeOfExpression(derived.TypeDesc.FullName))); 202if (ShouldInclude(arrayMapping) && !typesIncluded.Contains(arrayMapping.TypeDesc.FullName)) 205include.Arguments.Add(new CodeAttributeArgument(new CodeTypeOfExpression(arrayMapping.TypeDesc.FullName))); 207typesIncluded.Add(arrayMapping.TypeDesc.FullName, string.Empty); 223TypeKind kind = arrayMapping.Elements[0].Mapping.TypeDesc.Kind; 241CodeTypeDeclaration codeClass = new CodeTypeDeclaration(mapping.TypeDesc.Name); 300attribute.Arguments.Add(new CodeAttributeArgument(new CodeTypeOfExpression(derived.TypeDesc.FullName)));
FrameworkFork\Microsoft.Xml\Xml\Serialization\Mappings.cs (13)
629if (BaseMapping == null || BaseMapping.TypeDesc.IsRoot) 638throw new InvalidOperationException(string.Format(ResXml.XmlIllegalSimpleContentExtension, TypeDesc.FullName, BaseMapping.TypeDesc.FullName)); 649if (!_hasSimpleContent && text != null && !text.Mapping.TypeDesc.CanBeTextValue) 651throw new InvalidOperationException(string.Format(ResXml.XmlIllegalTypedTextAttribute, TypeDesc.FullName, text.Name, text.Mapping.TypeDesc.FullName)); 677if (TypeDesc.IsRoot) 683while (!start.BaseMapping.IsSequence && start.BaseMapping != null && !start.BaseMapping.TypeDesc.IsRoot) 695get { return _isSequence && !TypeDesc.IsRoot; } 773int w1 = a1.Mapping.TypeDesc.Weight; 774int w2 = a2.Mapping.TypeDesc.Weight; 846return element.IsNullable && element.Mapping.TypeDesc.IsValueType; 1152throw new InvalidOperationException(string.Format(ResXml.XmlCircularDerivation, TypeDesc.FullName));
FrameworkFork\Microsoft.Xml\Xml\Serialization\SchemaImporter.cs (2)
159TypeDesc typeDescToChange = structMapping.TypeDesc; 168throw new InvalidOperationException(string.Format(ResXml.XmlInvalidBaseType, structMapping.TypeDesc.FullName, baseType.FullName, typeDescToChange.BaseTypeDesc.FullName));
FrameworkFork\Microsoft.Xml\Xml\Serialization\SoapCodeExporter.cs (9)
116AddTypeMetadata(codeClass.CustomAttributes, typeof(SoapTypeAttribute), mapping.TypeDesc.Name, Accessor.UnescapeName(mapping.TypeName), mapping.Namespace, mapping.IncludeInSchema); 124if (mapping.TypeDesc.IsRoot) 132string className = mapping.TypeDesc.Name; 133string baseName = mapping.TypeDesc.BaseTypeDesc == null ? string.Empty : mapping.TypeDesc.BaseTypeDesc.Name; 149if (mapping.TypeDesc.IsAbstract) 232if (!sameName || mapping.TypeDesc.IsAmbiguousDataType || element.IsNullable) 234AddElementMetadata(metadata, sameName ? null : elemName, mapping.TypeDesc.IsAmbiguousDataType ? mapping.TypeDesc : null, element.IsNullable);
FrameworkFork\Microsoft.Xml\Xml\Serialization\SoapReflectionImporter.cs (17)
283if (mapping.TypeDesc != typeDesc) 284throw new InvalidOperationException(string.Format(ResXml.XmlTypesDuplicate, typeDesc.FullName, mapping.TypeDesc.FullName, typeName, ns)); 290TypeDesc typeDesc = baseMapping.TypeDesc.GetNullableTypeDesc(type); 306throw new InvalidOperationException(string.Format(ResXml.XmlTypesDuplicate, typeDesc.FullName, existingMapping.TypeDesc.FullName, typeDesc.Name, existingMapping.Namespace)); 311throw new InvalidOperationException(string.Format(ResXml.XmlTypesDuplicate, typeDesc.FullName, existingMapping.TypeDesc.FullName, typeDesc.Name, existingMapping.Namespace)); 454if (itemTypeMapping.TypeDesc.IsValueType && !itemTypeMapping.TypeDesc.IsPrimitive && !itemTypeMapping.TypeDesc.IsEnum) 471if (existingMapping.TypeDesc == model.TypeDesc) 506itemTypeNamespace = itemTypeMapping.TypeDesc.IsXsdType ? XmlSchema.Namespace : UrtTypes.Namespace; 507itemTypeName = itemTypeMapping.TypeDesc.DataType.Name; 512if (itemTypeMapping.TypeDesc.IsRoot) 531throw new InvalidOperationException(string.Format(ResXml.XmlInvalidSoapArray, mapping.TypeDesc.FullName)); 565if (mapping.TypeDesc == null) 569if (mapping.TypeDesc == null) 579mapping.TypeName = mapping.TypeDesc.DataType.Name; 580mapping.Namespace = mapping.TypeDesc.IsXsdType ? XmlSchema.Namespace : UrtTypes.Namespace;
FrameworkFork\Microsoft.Xml\Xml\Serialization\SoapSchemaExporter.cs (8)
182if (pm.TypeDesc.IsXsdType) 203XmlSchemaType type = mapping.TypeDesc.DataType; 212return new XmlQualifiedName(mapping.TypeDesc.DataType.Name, UrtTypes.Namespace); 217return new XmlQualifiedName(mapping.TypeDesc.DataType.Name, XmlSchema.Namespace); 319if (mapping.TypeDesc.IsRoot) return ExportRootMapping(mapping); 323if (!mapping.IncludeInSchema) throw new InvalidOperationException(string.Format(ResXml.XmlSoapCannotIncludeInSchema, mapping.TypeDesc.Name)); 329type.IsAbstract = mapping.TypeDesc.IsAbstract; 402if (derived.IncludeInSchema) ExportStructMapping(derived, mapping.TypeDesc.IsRoot ? null : mapping.Namespace);
FrameworkFork\Microsoft.Xml\Xml\Serialization\SoapSchemaImporter.cs (7)
312baseTypeDesc = ((StructMapping)baseMapping).TypeDesc; 461arrayMapping.TypeDesc = itemAccessor.Mapping.TypeDesc.CreateArrayTypeDesc(); 522arrayMapping.TypeDesc = itemAccessor.Mapping.TypeDesc.CreateArrayTypeDesc(); 540arrayMapping.TypeDesc = ((TypeMapping)itemAccessor.Mapping).TypeDesc.CreateArrayTypeDesc(); 566member.TypeDesc = ((TypeMapping)accessor.Mapping).TypeDesc; 611mapping.TypeName = mapping.TypeDesc.DataType.Name; 659mapping.TypeName = mapping.TypeDesc.DataType.Name;
FrameworkFork\Microsoft.Xml\Xml\Serialization\Types.cs (2)
765if (typeMapping.TypeDesc == typeDesc) 1179if (ShouldBeReplaced(pair.Value, structMapping.TypeDesc.Type, out replacedInfo))
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlCodeExporter.cs (60)
135if (mapping.TypeDesc.IsMappedType) 137codeClass = mapping.TypeDesc.ExtendedType.ExportTypeDefinition(CodeNamespace, CodeCompileUnit); 153if (!mapping.TypeDesc.IsMappedType) 164AddTypeMetadata(codeClass.CustomAttributes, typeof(XmlTypeAttribute), mapping.TypeDesc.Name, Accessor.UnescapeName(mapping.TypeName), mapping.Namespace, mapping.IncludeInSchema); 192if (typeMapping.TypeDesc.Name != name) 200if (typeMapping.TypeDesc != null && typeMapping.TypeDesc.IsAmbiguousDataType) 202attribute.Arguments.Add(new CodeAttributeArgument("DataType", new CodePrimitiveExpression(typeMapping.TypeDesc.DataType.Name))); 234CodeExpression enumRef = new CodeFieldReferenceExpression(new CodeTypeReferenceExpression(mapping.TypeDesc.FullName), values[i]); 243valueExpression = new CodeFieldReferenceExpression(new CodeTypeReferenceExpression(mapping.TypeDesc.FullName), (string)value); 286if (mapping.TypeDesc.FormatterName == "Date") 291else if (mapping.TypeDesc.FormatterName == "Time") 313if (mapping.TypeDesc.FullName != type.ToString() && !(mapping is EnumMapping)) 316initExpression = new CodeCastExpression(mapping.TypeDesc.FullName, initExpression); 377return XmlCustomFormatter.FromEnum(val, names, ids, em.TypeDesc.FullName); 387throw new InvalidOperationException(string.Format(ResXml.XmlInvalidDefaultValue, defaultValue, em.TypeDesc.FullName)); 393if (!pm.TypeDesc.HasCustomFormatter) 395if (pm.TypeDesc.FormatterName == "String") 397if (pm.TypeDesc.FormatterName == "DateTime") 402MethodInfo format = formatter.GetMethod("To" + pm.TypeDesc.FormatterName, new Type[] { typeof(string) }); 410if (pm.TypeDesc.HasDefaultSupport) 412return XmlCustomFormatter.ToDefaultValue(defaultValue, pm.TypeDesc.FormatterName); 441if (mapping.TypeDesc.IsMappedType && field != null && defaultValue is string) 443SchemaImporterExtension extension = mapping.TypeDesc.ExtendedType.Extension; 444CodeExpression init = extension.ImportDefaultValue((string)defaultValue, mapping.TypeDesc.FullName); 454field.InitExpression = extension.ImportDefaultValue((string)defaultValue, mapping.TypeDesc.FullName); 459DropDefaultAttribute(accessor, comments, mapping.TypeDesc.FullName); 484if (comments != null && !pm.TypeDesc.HasDefaultSupport && pm.TypeDesc.IsMappedType) 487DropDefaultAttribute(accessor, comments, pm.TypeDesc.FullName); 532if (arguments != null && pm.TypeDesc.HasDefaultSupport && accessor.IsOptional && !accessor.IsFixed) 562if (mapping.TypeDesc.IsRoot) 568string className = mapping.TypeDesc.Name; 569string baseName = mapping.TypeDesc.BaseTypeDesc == null || mapping.TypeDesc.BaseTypeDesc.IsRoot ? string.Empty : mapping.TypeDesc.BaseTypeDesc.FullName; 580if (mapping.TypeDesc.IsAbstract) 593if (mapping.TypeDesc.IsAbstract) 691bool sameName = arrayElement.Mapping.TypeDesc.IsArray ? false : elementName == arrayElement.Mapping.TypeName; 692bool sameElementType = elementMapping.TypeDesc == elementTypeDesc; 694bool sameNullable = arrayElement.IsNullable == elementMapping.TypeDesc.IsNullable; 697ExportArrayItem(metadata, sameName ? null : elementName, sameElementNs ? null : arrayElement.Namespace, sameElementType ? null : elementMapping.TypeDesc, elementMapping.TypeDesc, arrayElement.IsNullable, defaultForm ? XmlSchemaForm.None : arrayElement.Form, nestingLevel); 719bool sameType = mapping.TypeDesc == member.TypeDesc || 720(member.TypeDesc.IsArrayLike && mapping.TypeDesc == member.TypeDesc.ArrayElementTypeDesc); 727sameType ? null : mapping.TypeDesc, 728mapping.TypeDesc, 739bool sameType = mapping.TypeDesc == member.TypeDesc || 740(member.TypeDesc.IsArrayLike && mapping.TypeDesc == member.TypeDesc.ArrayElementTypeDesc); 741ExportText(metadata, sameType ? null : mapping.TypeDesc, mapping.TypeDesc.IsAmbiguousDataType ? mapping.TypeDesc.DataType.Name : null); 757bool sameType = mapping.TypeDesc == member.TypeDesc; 761else if (mapping.TypeDesc.ArrayElementTypeDesc == new TypeScope().GetTypeDesc(typeof(byte))) 771bool sameType = mapping.TypeDesc == member.TypeDesc || 772(member.TypeDesc.IsArrayLike && mapping.TypeDesc == member.TypeDesc.ArrayElementTypeDesc); 775ExportElement(metadata, sameName ? null : elemName, sameNs ? null : element.Namespace, sameType ? null : mapping.TypeDesc, mapping.TypeDesc, element.IsNullable, defaultForm ? XmlSchemaForm.None : element.Form, member.SequenceId); 791ExportElement(metadata, elemName, sameNs ? null : element.Namespace, ((TypeMapping)element.Mapping).TypeDesc, ((TypeMapping)element.Mapping).TypeDesc, element.IsNullable, defaultForm ? XmlSchemaForm.None : element.Form, member.SequenceId);
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlReflectionImporter.cs (28)
127if (mapping.IsAnonymousType && !mapping.TypeDesc.IsSpecial) 295return ((TypeMapping)mapping).TypeDesc.FullName; 324if (accessor.Mapping.TypeDesc == existing.Mapping.TypeDesc 325|| (existing.Mapping is NullableMapping && accessor.Mapping.TypeDesc == ((NullableMapping)existing.Mapping).BaseMapping.TypeDesc) 326|| (accessor.Mapping is NullableMapping && ((NullableMapping)accessor.Mapping).BaseMapping.TypeDesc == existing.Mapping.TypeDesc)) 508CheckContext(mapping.TypeDesc, context); 650TypeDesc typeDesc = baseMapping.TypeDesc.GetNullableTypeDesc(type); 675throw new InvalidOperationException(string.Format(ResXml.XmlTypesDuplicate, typeDesc.FullName, existingMapping.TypeDesc.FullName, typeDesc.Name, existingMapping.Namespace)); 680throw new InvalidOperationException(string.Format(ResXml.XmlTypesDuplicate, typeDesc.FullName, existingMapping.TypeDesc.FullName, typeDesc.Name, existingMapping.Namespace)); 721if (!mapping.IsAnonymousType && mapping.TypeDesc != typeDesc) 722throw new InvalidOperationException(string.Format(ResXml.XmlTypesDuplicate, typeDesc.FullName, mapping.TypeDesc.FullName, typeName, ns)); 870if (!member.Text.Mapping.TypeDesc.CanBeTextValue && member.Text.Mapping.IsList) 871throw new InvalidOperationException(string.Format(ResXml.XmlIllegalTypedTextAttribute, typeName, member.Text.Name, member.Text.Mapping.TypeDesc.FullName)); 1040name = itemTypeMapping.TypeDesc.DataType.Name; 1042else if (itemTypeMapping is StructMapping && itemTypeMapping.TypeDesc.IsRoot) 1118if (existingMapping.TypeDesc == model.TypeDesc) 1163if (mapping.TypeDesc == null) 1167if (mapping.TypeDesc == null) 1177mapping.TypeName = mapping.TypeDesc.DataType.Name; 1178mapping.Namespace = mapping.TypeDesc.IsXsdType ? XmlSchema.Namespace : UrtTypes.Namespace; 1180CheckContext(mapping.TypeDesc, context); 1816if (element.Mapping.TypeDesc.Kind == TypeKind.Node) 2016throw new InvalidOperationException(string.Format(ResXml.XmlChoiceMissingAnyValue, accessor.ChoiceIdentifier.Mapping.TypeDesc.FullName)); 2022throw new InvalidOperationException(string.Format(ResXml.XmlChoiceMissingValue, accessor.ChoiceIdentifier.Mapping.TypeDesc.FullName, id, element.Name, element.Namespace)); 2228bool isAny = mapping.TypeDesc.Kind == TypeKind.Node;
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSchemaExporter.cs (29)
258if (!accessor.Mapping.IncludeInSchema && !accessor.Mapping.TypeDesc.IsRoot) 439XmlSchemaSimpleType type = (XmlSchemaSimpleType)mapping.TypeDesc.DataType; 448return new XmlQualifiedName(mapping.TypeDesc.DataType.Name, UrtTypes.Namespace); 453switch (mapping.TypeDesc.Kind) 458type.IsMixed = mapping.TypeDesc.IsMixed; 479type.IsMixed = mapping.TypeDesc.IsMixed; 615if (mapping.TypeDesc.IsXsdType) 617qname = new XmlQualifiedName(mapping.TypeDesc.DataType.Name, XmlSchema.Namespace); 768if (!accessor.HasDefault && !valueTypeOptional && accessor.Mapping.TypeDesc.IsValueType) 856int minOccurs = repeats || accessor.HasDefault || (!accessor.IsNullable && !accessor.Mapping.TypeDesc.IsValueType) || valueTypeOptional ? 0 : 1; 936return val != 0 ? XmlCustomFormatter.FromEnum(val, names, ids, mapping.TypeDesc.FullName) : null; 953if (!pm.TypeDesc.HasCustomFormatter) 957if (pm.TypeDesc.Type == null) 959throw new InvalidOperationException(string.Format(ResXml.XmlInternalErrorDetails, "Mapping for " + pm.TypeDesc.Name + " missing type property")); 963if (pm.TypeDesc.FormatterName == "String") 967System.Reflection.MethodInfo format = formatter.GetMethod("ToString", new Type[] { pm.TypeDesc.Type }); 973string defaultValue = XmlCustomFormatter.FromDefaultValue(value, pm.TypeDesc.FormatterName); 975throw new InvalidOperationException(string.Format(ResXml.XmlInvalidDefaultValue, value.ToString(), pm.TypeDesc.Name)); 978throw new InvalidOperationException(string.Format(ResXml.XmlInvalidDefaultValue, value.ToString(), pm.TypeDesc.Name)); 987if (mapping is StructMapping && mapping.TypeDesc.IsRoot) 1004if (mapping.TypeDesc.IsRoot) 1012throw new InvalidOperationException(string.Format(ResXml.XmlCircularReference2, mapping.TypeDesc.Name, "AnonymousType", "false")); 1018if (!mapping.IncludeInSchema) throw new InvalidOperationException(string.Format(ResXml.XmlCannotIncludeInSchema, mapping.TypeDesc.Name)); 1027type.IsAbstract = mapping.TypeDesc.IsAbstract; 1033throw new InvalidOperationException(string.Format(ResXml.XmlAnonymousBaseType, mapping.TypeDesc.Name, mapping.BaseMapping.TypeDesc.Name, "AnonymousType", "false")); 1139throw new InvalidOperationException(string.Format(ResXml.XmlAnonymousBaseType, textMapping.TypeDesc.Name, pm.TypeDesc.Name, "AnonymousType", "false")); 1186if (!mapping.IncludeInSchema) throw new InvalidOperationException(string.Format(ResXml.XmlCannotIncludeInSchema, mapping.TypeDesc.Name));
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSchemaImporter.cs (44)
82mapping.TypeName = mapping.TypeDesc.DataType.Name; 152accessor.IsNullable = typeMapping.TypeDesc.IsNullable; 262member.TypeDesc = accessor.Mapping.TypeDesc; 413if (!mapping.TypeDesc.IsMappedType) 469mapping.TypeDesc = mapping.TypeDesc.CreateMappedTypeDesc(new MappedTypeDesc(typeName, qname.Name, qname.Namespace, type, context, typeOwner, mainNamespace, compileUnit.ReferencedAssemblies)); 475top.TypeDesc = mapping.TypeDesc; 611baseTypeDesc = ((StructMapping)baseMapping).TypeDesc; 619baseTypeDesc = baseMapping.TypeDesc; 696throw new InvalidOperationException(string.Format(ResXml.XmlIllegalOverride, type.Name, baseMember.Name, baseMember.TypeDesc.FullName, structMapping.Members[i].TypeDesc.FullName, declaringMapping.TypeDesc.FullName)); 887string tdFullName = element.Mapping.TypeDesc.FullName; 924typeDescs[i] = ((ElementAccessor)enumerator.Current).Mapping.TypeDesc; 959choiceIdentifier.TypeDesc = member.ChoiceIdentifier.Mapping.TypeDesc.CreateArrayTypeDesc(); 963choiceIdentifier.TypeDesc = member.ChoiceIdentifier.Mapping.TypeDesc; 1000if (item.Mapping.TypeDesc != null) 1002if (item.IsNullable != item.Mapping.TypeDesc.IsNullable) 1005if (item.Mapping.TypeDesc.IsAmbiguousDataType) 1099if (scopeElement.Mapping.TypeDesc != element.Mapping.TypeDesc) 1224if (!(mapping is PrimitiveMapping || mapping.TypeDesc.CanBeTextValue)) 1245member.TypeDesc = accessor.Mapping.TypeDesc.CreateArrayTypeDesc(); 1254member.TypeDesc = accessor.Mapping.TypeDesc.CreateArrayTypeDesc(); 1259member.TypeDesc = accessor.Mapping.TypeDesc; 1276member.TypeDesc = ((TypeMapping)accessors[0].Mapping).TypeDesc; 1284textMapping.TypeName = textMapping.TypeDesc.Name; 1285member.TypeDesc = textMapping.TypeDesc; 1304mapping.TypeName = mapping.TypeDesc.Name; 1356if (arrayMapping.TypeDesc.IsNullable) 1399arrayMapping.TypeName = (type.Name == null || type.Name.Length == 0) ? "ArrayOf" + CodeIdentifier.MakePascal(arrayMapping.TypeDesc.Name) : type.Name; 1415arrayMapping.TypeDesc = ((TypeMapping)itemAccessor.Mapping).TypeDesc.CreateArrayTypeDesc(); 1416arrayMapping.TypeName = (type.Name == null || type.Name.Length == 0) ? "ArrayOf" + CodeIdentifier.MakePascal(itemAccessor.Mapping.TypeDesc.Name) : type.Name; 1505mapping.TypeName = mapping.TypeDesc.Name; 1507mapping.TypeDesc = mapping.TypeDesc.CreateArrayTypeDesc(); 1541member.TypeDesc = accessor.Mapping.TypeDesc; 1545member.TypeDesc = accessor.Mapping.TypeDesc; 1559member.TypeDesc = accessor.Mapping.TypeDesc.CreateArrayTypeDesc(); 1584member.TypeDesc = accessor.IsList ? accessor.Mapping.TypeDesc.CreateArrayTypeDesc() : accessor.Mapping.TypeDesc; 1596mapping.TypeName = mapping.TypeDesc.Name; 1608member.TypeDesc = ((TypeMapping)accessor.Mapping).TypeDesc; 1657xmlnsMapping.TypeName = xmlnsMapping.TypeDesc.Name; 1693mapping.TypeName = mapping.TypeDesc.DataType.Name; 1728if (mapping != null && !mapping.TypeDesc.IsMappedType) 1933mapping.Namespace = mapping.TypeDesc.IsXsdType ? XmlSchema.Namespace : UrtTypes.Namespace; 1949mapping.Namespace = mapping.TypeDesc.IsXsdType ? XmlSchema.Namespace : ns;
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationGeneratedCode.cs (1)
216return mapping.TypeDesc.CanBeElementValue;
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationILGen.cs (3)
306string serializerName = CodeIdentifier.MakeValid(Accessor.UnescapeName(mapping.Accessor.Mapping.TypeDesc.Name)); 446Type type = xmlMappings[i].Accessor.Mapping.TypeDesc.Type; 562return mapping.TypeDesc.CanBeElementValue;
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationWriter.cs (120)
1543MethodNames.Add(mapping, NextMethodName(mapping.TypeDesc.Name)); 1614!typeMapping.TypeDesc.IsRoot) 1618Writer.Write(RaCodeGen.GetStringForTypeof(typeMapping.TypeDesc.CSharpName, typeMapping.TypeDesc.UseReflection)); 1680if (methodName == null) throw new InvalidOperationException(string.Format(ResXml.XmlInternalErrorMethod, mapping.TypeDesc.Name) + Environment.StackTrace); 1719TypeDesc typeDesc = mapping.TypeDesc; 1720bool hasDefault = defaultValue != null && defaultValue != DBNull.Value && mapping.TypeDesc.HasDefaultSupport; 1731if (mapping.TypeDesc.UseReflection) 1732Writer.Write(RaCodeGen.GetStringForEnumLongValue(source, mapping.TypeDesc.UseReflection)); 1746Writer.Write(RaCodeGen.GetStringForEnumCompare((EnumMapping)mapping, values[i], mapping.TypeDesc.UseReflection)); 1752Writer.Write(RaCodeGen.GetStringForEnumCompare((EnumMapping)mapping, (string)defaultValue, mapping.TypeDesc.UseReflection)); 2016if (member.ChoiceIdentifier.Mapping.TypeDesc.UseReflection) 2107if (!mapping.IsSoap && !mapping.TypeDesc.IsValueType && !mapping.TypeDesc.Type.GetTypeInfo().IsPrimitive) 2112WriteMember("o", null, new ElementAccessor[] { element }, null, null, mapping.TypeDesc, !element.IsSoap); 2132string fullTypeName = mapping.TypeDesc.CSharpName; 2138WriteLocalDecl(fullTypeName, "v", "e", mapping.TypeDesc.UseReflection); 2145Writer.Write(mapping.TypeDesc.UseReflection ? "object" : fullTypeName); 2155if (mapping.TypeDesc.UseReflection) 2156Writer.WriteLine("switch (" + RaCodeGen.GetStringForEnumLongValue("v", mapping.TypeDesc.UseReflection) + " ){"); 2165WriteEnumCase(fullTypeName, c, mapping.TypeDesc.UseReflection); 2177Writer.Write(RaCodeGen.GetStringForEnumLongValue("v", mapping.TypeDesc.UseReflection)); 2197if (mapping.TypeDesc.UseReflection) 2209WriteQuotedCSharpString(mapping.TypeDesc.FullName); 2215Writer.Write(RaCodeGen.GetStringForEnumLongValue("v", mapping.TypeDesc.UseReflection)); 2217WriteQuotedCSharpString(mapping.TypeDesc.FullName); 2244string fullTypeName = derived.TypeDesc.CSharpName; 2246WriteTypeCompare("t", fullTypeName, derived.TypeDesc.UseReflection); 2254if (methodName == null) throw new InvalidOperationException("deriaved from " + mapping.TypeDesc.FullName + ", " + string.Format(ResXml.XmlInternalErrorMethod, derived.TypeDesc.Name) + Environment.StackTrace); 2259if (!derived.TypeDesc.UseReflection) Writer.Write("(" + fullTypeName + ")"); 2261if (derived.TypeDesc.IsNullable) 2282string fullTypeName = mapping.TypeDesc.CSharpName; 2284WriteTypeCompare("t", fullTypeName, mapping.TypeDesc.UseReflection); 2292if (methodName == null) throw new InvalidOperationException(string.Format(ResXml.XmlInternalErrorMethod, mapping.TypeDesc.Name) + Environment.StackTrace); 2303if (!mapping.TypeDesc.UseReflection) Writer.Write("(" + fullTypeName + ")"); 2314string fullTypeName = mapping.TypeDesc.CSharpName; 2316if (mapping.TypeDesc.IsArray) 2317WriteArrayTypeCompare("t", fullTypeName, mapping.TypeDesc.ArrayElementTypeDesc.CSharpName, mapping.TypeDesc.UseReflection); 2319WriteTypeCompare("t", fullTypeName, mapping.TypeDesc.UseReflection); 2330WriteMember("o", null, mapping.ElementsSortedByDerivation, null, null, mapping.TypeDesc, true); 2343if (mapping.IsSoap && mapping.TypeDesc.IsRoot) return; 2350string fullTypeName = mapping.TypeDesc.CSharpName; 2356WriteLocalDecl(fullTypeName, "o", "s", mapping.TypeDesc.UseReflection); 2361Writer.Write(mapping.TypeDesc.UseReflection ? "object" : fullTypeName); 2363if (mapping.TypeDesc.IsNullable) 2367if (mapping.TypeDesc.IsNullable) 2382WriteTypeCompare("t", fullTypeName, mapping.TypeDesc.UseReflection); 2386if (mapping.TypeDesc.IsRoot) 2391if (mapping.TypeDesc.IsRoot) 2406if (!mapping.TypeDesc.IsAbstract) 2408if (mapping.TypeDesc.Type != null && typeof(XmlSchemaObject).IsAssignableFrom(mapping.TypeDesc.Type)) 2420xmlnsSource = RaCodeGen.GetStringForMember("o", member.Name, mapping.TypeDesc); 2421if (mapping.TypeDesc.UseReflection) 2436if (!mapping.TypeDesc.IsRoot) 2458string methodInvoke = RaCodeGen.GetStringForMethodInvoke("o", fullTypeName, "ShouldSerialize" + m.Name, mapping.TypeDesc.UseReflection); 2459if (mapping.TypeDesc.UseReflection) methodInvoke = "((" + typeof(bool).FullName + ")" + methodInvoke + ")"; 2467string memberGet = RaCodeGen.GetStringForMember("o", m.Name + "Specified", mapping.TypeDesc); 2468if (mapping.TypeDesc.UseReflection) memberGet = "((" + typeof(bool).FullName + ")" + memberGet + ")"; 2473WriteMember(RaCodeGen.GetStringForMember("o", m.Name, mapping.TypeDesc), m.Attribute, m.TypeDesc, "o"); 2499string methodInvoke = RaCodeGen.GetStringForMethodInvoke("o", fullTypeName, "ShouldSerialize" + m.Name, mapping.TypeDesc.UseReflection); 2500if (mapping.TypeDesc.UseReflection) methodInvoke = "((" + typeof(bool).FullName + ")" + methodInvoke + ")"; 2508string memberGet = RaCodeGen.GetStringForMember("o", m.Name + "Specified", mapping.TypeDesc); 2509if (mapping.TypeDesc.UseReflection) memberGet = "((" + typeof(bool).FullName + ")" + memberGet + ")"; 2519choiceSource = RaCodeGen.GetStringForMember("o", m.ChoiceIdentifier.MemberName, mapping.TypeDesc); 2521WriteMember(RaCodeGen.GetStringForMember("o", m.Name, mapping.TypeDesc), choiceSource, m.ElementsSortedByDerivation, m.Text, m.ChoiceIdentifier, m.TypeDesc, true); 2728if (special.TypeDesc.Kind == TypeKind.Attribute || special.TypeDesc.CanBeAttributeValue) 2741TypeDesc typeDesc = attribute.Mapping.TypeDesc; 2772bool choiceUseReflection = choice.Mapping.TypeDesc.UseReflection; 2773string choiceFullName = choice.Mapping.TypeDesc.CSharpName; 2774WriteArrayLocalDecl(choiceFullName + "[]", "c", choiceSource, choice.Mapping.TypeDesc); 2779WriteQuotedCSharpString(choice.Mapping.TypeDesc.FullName); 2884string choiceFullName = choice.Mapping.TypeDesc.CSharpName; 2885WriteLocalDecl(choiceFullName, choiceName + "i", RaCodeGen.GetStringForArrayMember(choiceName, "i" + arrayName, choice.Mapping.TypeDesc), choice.Mapping.TypeDesc.UseReflection); 2908TypeDesc td = elements[0].IsUnbounded ? elements[0].Mapping.TypeDesc.CreateArrayTypeDesc() : elements[0].Mapping.TypeDesc; 2909if (!elements[0].Any && !elements[0].Mapping.TypeDesc.UseReflection && !elements[0].Mapping.TypeDesc.IsOptionalValue) 2927string enumTypeName = choice == null ? null : choice.Mapping.TypeDesc.FullName; 2943bool useReflection = element.Mapping.TypeDesc.UseReflection; 2944string fullTypeName = element.Mapping.TypeDesc.CSharpName; 2945bool enumUseReflection = choice.Mapping.TypeDesc.UseReflection; 2963WriteChoiceTypeCheck(source, fullTypeName, useReflection, choice, enumFullName, element.Mapping.TypeDesc); 2974bool useReflection = element.Mapping.TypeDesc.UseReflection; 2975TypeDesc td = element.IsUnbounded ? element.Mapping.TypeDesc.CreateArrayTypeDesc() : element.Mapping.TypeDesc; 3019bool useReflection = element.Mapping.TypeDesc.UseReflection; 3022bool enumUseReflection = choice.Mapping.TypeDesc.UseReflection; 3088bool useReflection = text.Mapping.TypeDesc.UseReflection; 3089string fullTypeName = text.Mapping.TypeDesc.CSharpName; 3150WritePrimitiveValue(mapping.TypeDesc, source, false); 3157switch (mapping.TypeDesc.Kind) 3179string fullTypeName = element.Mapping.TypeDesc.BaseTypeDesc.CSharpName; 3181if (!element.Mapping.TypeDesc.BaseTypeDesc.UseReflection) 3211Writer.Write(RaCodeGen.GetStringForTypeof(mapping.TypeDesc.CSharpName, mapping.TypeDesc.UseReflection)); 3223TypeDesc td = mapping.TypeDesc.CreateArrayTypeDesc(); 3229WriteArrayLocalDecl(fullTypeName, elementArrayName, source, mapping.TypeDesc); 3236if (mapping.TypeDesc.IsNullable) 3284string fullTypeName = mapping.TypeDesc.CSharpName; 3287WriteArrayLocalDecl(fullTypeName, arrayName, source, mapping.TypeDesc); 3294if (mapping.TypeDesc.IsNullable) 3304WriteArrayItems(mapping.ElementsSortedByDerivation, null, null, mapping.TypeDesc, arrayName, null); 3336if (mapping.TypeDesc == QnameTypeDesc) 3341string suffixRaw = mapping.TypeDesc.XmlEncodingNotRequired ? "Raw" : ""; 3361Writer.Write(RaCodeGen.GetStringForTypeof(mapping.TypeDesc.CSharpName, mapping.TypeDesc.UseReflection)); 3376if (methodName == null) throw new InvalidOperationException(string.Format(ResXml.XmlInternalErrorMethod, mapping.TypeDesc.Name) + Environment.StackTrace); 3390if (mapping.TypeDesc.IsNullable) 3402bool useReflection = mapping.TypeDesc.UseReflection; 3403TypeDesc td = mapping.TypeDesc; 3700throw new InvalidOperationException(string.Format(ResXml.XmlChoiceMissingAnyValue, choiceMapping.TypeDesc.FullName)); 3703throw new InvalidOperationException(string.Format(ResXml.XmlChoiceMissingValue, choiceMapping.TypeDesc.FullName, element.Namespace + ":" + element.Name, element.Name, element.Namespace)); 3917string typeFullName = mapping.TypeDesc.CSharpName; 4127return mapping.TypeDesc.CSharpName + ".@" + memberName; 4129string memberAccess = GetStringForEnumMember(mapping.TypeDesc.CSharpName, memberName, useReflection);
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationWriterILGen.cs (96)
39MethodNames.Add(mapping, NextMethodName(mapping.TypeDesc.Name)); 108source.Load(mapping.TypeDesc.Type); 109argTypes.Add(mapping.TypeDesc.Type); 132if (methodName == null) throw new InvalidOperationException(string.Format(ResXml.XmlInternalErrorMethod, mapping.TypeDesc.Name) + Environment.StackTrace); 141new Type[] { mapping.TypeDesc.Type }); 143source.Load(mapping.TypeDesc.Type); 196TypeDesc typeDesc = mapping.TypeDesc; 197bool hasDefault = defaultValue != null && defaultValue != DBNull.Value && mapping.TypeDesc.HasDefaultSupport; 207source.Load(mapping.TypeDesc.Type); 225ilg.Ldc(Enum.Parse(mapping.TypeDesc.Type, enumDefaultValue, false)); 588if (!mapping.TypeDesc.IsValueType && !mapping.TypeDesc.Type.GetTypeInfo().IsPrimitive) 601WriteMember(new SourceInfo("o", "o", null, typeof(object), ilg), null, new ElementAccessor[] { element }, null, null, mapping.TypeDesc, true); 617argTypes.Add(mapping.TypeDesc.Type); 639LocalBuilder localTmp = ilg.DeclareLocal(mapping.TypeDesc.Type, "localTmp"); 649ilg.Ldc(Enum.ToObject(mapping.TypeDesc.Type, c.Value)); 695ilg.Ldstr(mapping.TypeDesc.FullName); 743ilg.ConvertValue(mapping.TypeDesc.Type, typeof(Int64)); 750ilg.Ldstr(mapping.TypeDesc.FullName); 765WriteTypeCompare("t", derived.TypeDesc.Type); 772if (methodName == null) throw new InvalidOperationException("deriaved from " + mapping.TypeDesc.FullName + ", " + string.Format(ResXml.XmlInternalErrorMethod, derived.TypeDesc.Name) + Environment.StackTrace); 784ilg.ConvertValue(oType, derived.TypeDesc.Type); 785argTypes.Add(derived.TypeDesc.Type); 786if (derived.TypeDesc.IsNullable) 815WriteTypeCompare("t", mapping.TypeDesc.Type); 823if (methodName == null) throw new InvalidOperationException(string.Format(ResXml.XmlInternalErrorMethod, mapping.TypeDesc.Name) + Environment.StackTrace); 859new Type[] { mapping.TypeDesc.Type } 873ilg.ConvertValue(ilg.GetVariableType(oVar), mapping.TypeDesc.Type); 893if (mapping.TypeDesc.IsArray) 894WriteArrayTypeCompare("t", mapping.TypeDesc.Type); 896WriteTypeCompare("t", mapping.TypeDesc.Type); 932WriteMember(new SourceInfo("o", "o", null, null, ilg), null, mapping.ElementsSortedByDerivation, null, null, mapping.TypeDesc, true); 962argTypes.Add(mapping.TypeDesc.Type); 964if (mapping.TypeDesc.IsNullable) 976if (mapping.TypeDesc.IsNullable) 1014WriteTypeCompare("t", mapping.TypeDesc.Type); 1018if (mapping.TypeDesc.IsRoot) 1021if (mapping.TypeDesc.IsRoot) 1056if (!mapping.TypeDesc.IsAbstract) 1058if (mapping.TypeDesc.Type != null && typeof(XmlSchemaObject).IsAssignableFrom(mapping.TypeDesc.Type)) 1079xmlnsSource = RaCodeGen.GetStringForMember("o", member.Name, mapping.TypeDesc); 1105if (!mapping.TypeDesc.IsRoot) 1137string memberGet = RaCodeGen.GetStringForMember("o", m.Name + "Specified", mapping.TypeDesc); 1141WriteMember(RaCodeGen.GetSourceForMember("o", m, mapping.TypeDesc, ilg), m.Attribute, m.TypeDesc, "o"); 1170string memberGet = RaCodeGen.GetStringForMember("o", m.Name + "Specified", mapping.TypeDesc); 1179choiceSource = RaCodeGen.GetStringForMember("o", m.ChoiceIdentifier.MemberName, mapping.TypeDesc); 1182WriteMember(RaCodeGen.GetSourceForMember("o", m, m.MemberInfo, mapping.TypeDesc, ilg), choiceSource, m.ElementsSortedByDerivation, m.Text, m.ChoiceIdentifier, m.TypeDesc, true); 1442if (special.TypeDesc.Kind == TypeKind.Attribute || special.TypeDesc.CanBeAttributeValue) 1463TypeDesc typeDesc = attribute.Mapping.TypeDesc; 1513string choiceFullName = choice.Mapping.TypeDesc.CSharpName; 1515cName = "c" + choice.Mapping.TypeDesc.Name; 1516WriteArrayLocalDecl(choiceFullName + "[]", cName, choiceSourceInfo, choice.Mapping.TypeDesc); 1542ilg.Ldstr(choice.Mapping.TypeDesc.FullName); 1636WriteLocalDecl(choiceName + "i", RaCodeGen.GetStringForArrayMember(choiceName, iPlusArrayName, choice.Mapping.TypeDesc), choice.Mapping.TypeDesc.Type); 1653TypeDesc td = elements[0].IsUnbounded ? elements[0].Mapping.TypeDesc.CreateArrayTypeDesc() : elements[0].Mapping.TypeDesc; 1654if (!elements[0].Any && !elements[0].Mapping.TypeDesc.IsOptionalValue) 1672string enumTypeName = choice == null ? null : choice.Mapping.TypeDesc.FullName; 1688string fullTypeName = element.Mapping.TypeDesc.CSharpName; 1694ILGenLoad(enumSource, choice == null ? null : choice.Mapping.TypeDesc.Type); 1712WriteChoiceTypeCheck(source, fullTypeName, choice, enumFullName, element.Mapping.TypeDesc); 1715castedSource = source.CastTo(element.Mapping.TypeDesc); 1720TypeDesc td = element.IsUnbounded ? element.Mapping.TypeDesc.CreateArrayTypeDesc() : element.Mapping.TypeDesc; 1776ILGenLoad(enumSource, choice == null ? null : choice.Mapping.TypeDesc.Type); 1904string fullTypeName = text.Mapping.TypeDesc.CSharpName; 1908WriteInstanceOf(source, text.Mapping.TypeDesc.Type); 1910SourceInfo castedSource = source.CastTo(text.Mapping.TypeDesc); 1915SourceInfo castedSource = source.CastTo(text.Mapping.TypeDesc); 1966WritePrimitiveValue(mapping.TypeDesc, source, out argType); 1980switch (mapping.TypeDesc.Kind) 2014if (source.Type == element.Mapping.TypeDesc.Type) 2016MethodInfo Nullable_get_HasValue = element.Mapping.TypeDesc.Type.GetMethod( 2023source.LoadAddress(element.Mapping.TypeDesc.Type); 2033string fullTypeName = element.Mapping.TypeDesc.BaseTypeDesc.CSharpName; 2034SourceInfo castedSource = source.CastTo(element.Mapping.TypeDesc.BaseTypeDesc); 2055string fullTypeName = mapping.TypeDesc.CSharpName; 2056WriteArrayLocalDecl(fullTypeName, arrayName, source, mapping.TypeDesc); 2063if (mapping.TypeDesc.IsNullable) 2071WriteArrayItems(mapping.ElementsSortedByDerivation, null, null, mapping.TypeDesc, arrayName, null); 2079if (mapping.TypeDesc.IsNullable) 2094if (mapping.TypeDesc == QnameTypeDesc) 2098string suffixRaw = mapping.TypeDesc.XmlEncodingNotRequired ? "Raw" : ""; 2111if (methodName == null) throw new InvalidOperationException(string.Format(ResXml.XmlInternalErrorMethod, mapping.TypeDesc.Name) + Environment.StackTrace); 2119source.Load(mapping.TypeDesc.Type); 2120argTypes.Add(mapping.TypeDesc.Type); 2121if (mapping.TypeDesc.IsNullable) 2138TypeDesc td = mapping.TypeDesc; 2388eValue = Enum.ToObject(choiceMapping.TypeDesc.Type, choiceMapping.Constants[i].Value); 2402eValue = Enum.ToObject(choiceMapping.TypeDesc.Type, choiceMapping.Constants[i].Value); 2412throw new InvalidOperationException(string.Format(ResXml.XmlChoiceMissingAnyValue, choiceMapping.TypeDesc.FullName)); 2415throw new InvalidOperationException(string.Format(ResXml.XmlChoiceMissingValue, choiceMapping.TypeDesc.FullName, element.Namespace + ":" + element.Name, element.Name, element.Namespace));
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlTypeMapping.cs (2)
31get { return Mapping.TypeDesc.Name; } 40get { return Mapping.TypeDesc.FullName; }