52 writes to Mapping
System.Xml (52)
System\Xml\Serialization\Mappings.cs (1)
151
newAccessor.
Mapping
= this.Mapping;
System\Xml\Serialization\SoapReflectionImporter.cs (5)
110
element.
Mapping
= ImportTypeMapping(modelScope.GetTypeModel(type), new RecursionLimiter());
153
element.
Mapping
= ImportMembersMapping(members, ns, hasWrapperElement, writeAccessors, validate, new RecursionLimiter());
652
attribute.
Mapping
= ImportTypeMapping(modelScope.GetTypeModel(accessorType), (a.SoapAttribute == null ? String.Empty : a.SoapAttribute.DataType), limiter);
666
element.
Mapping
= ImportTypeMapping(modelScope.GetTypeModel(accessorType), (a.SoapElement == null ? String.Empty : a.SoapElement.DataType), limiter);
678
element.
Mapping
= mapping;
System\Xml\Serialization\SoapSchemaImporter.cs (7)
72
accessor.
Mapping
= mapping;
97
accessor.
Mapping
= mapping;
153
accessor.
Mapping
= mapping;
174
accessor.
Mapping
= mapping;
391
arrayAccessor.
Mapping
= arrayMapping;
407
itemAccessor.
Mapping
= mapping;
460
itemAccessor.
Mapping
= mapping;
System\Xml\Serialization\XmlReflectionImporter.cs (14)
201
element.
Mapping
= membersMapping;
1307
arrayItemElement.
Mapping
= ImportTypeMapping(modelScope.GetTypeModel(targetType), arrayItemElement.Namespace, ImportContext.Element, xmlArrayItem.DataType, null, limiter);
1352
accessor.ChoiceIdentifier.
Mapping
= ImportTypeMapping(modelScope.GetTypeModel(choiceIdentifierType), ns, ImportContext.Element, String.Empty, null, limiter);
1390
attribute.
Mapping
= ImportTypeMapping(modelScope.GetTypeModel(targetType), ns, ImportContext.Attribute, a.XmlAttribute.DataType, null, isList, false, limiter);
1411
text.
Mapping
= ImportTypeMapping(modelScope.GetTypeModel(targetType), ns, ImportContext.Text, a.XmlText.DataType, null, true, false, limiter);
1427
element.
Mapping
= ImportTypeMapping(typeModel, rpc ? ns : element.Namespace, ImportContext.Element, xmlElement.DataType, null, limiter);
1480
element.
Mapping
= ImportTypeMapping(typeModel, element.Namespace, ImportContext.Element, String.Empty, null, limiter);
1516
arrayElement.
Mapping
= arrayMapping;
1552
attribute.
Mapping
= ImportTypeMapping(modelScope.GetTypeModel(accessorType), ns, ImportContext.Attribute, a.XmlAttribute.DataType, null, limiter);
1568
text.
Mapping
= ImportTypeMapping(modelScope.GetTypeModel(accessorType), ns, ImportContext.Text, a.XmlText.DataType, null, limiter);
1585
element.
Mapping
= ImportTypeMapping(typeModel, rpc ? ns : element.Namespace, ImportContext.Element, xmlElement.DataType, null, limiter);
1639
element.
Mapping
= ImportTypeMapping(typeModel, rpc ? ns : element.Namespace, ImportContext.Element, xmlElement.DataType, null, false, openModel, limiter);
1696
element.
Mapping
= ImportTypeMapping(typeModel, element.Namespace, ImportContext.Element, String.Empty, null, false, openModel, limiter);
1946
element.
Mapping
= mapping;
System\Xml\Serialization\XmlSchemaImporter.cs (21)
99
element.
Mapping
= ((ArrayMapping)element.Mapping).TopLevelMapping;
139
accessor.
Mapping
= typeMapping;
152
accessor.
Mapping
= ((ArrayMapping)accessor.Mapping).TopLevelMapping;
201
accessor.
Mapping
= mapping;
249
element.
Mapping
= mapping;
268
accessor.
Mapping
= mapping;
314
accessor.
Mapping
= mapping;
790
element.
Mapping
= arrayMapping.TopLevelMapping;
826
member.ChoiceIdentifier.
Mapping
= ImportEnumeratedChoice(member.Elements, ns, member.Name + "ChoiceType");
847
choiceAccessor.
Mapping
= member.ChoiceIdentifier.Mapping;
1068
accessor.
Mapping
= mapping;
1112
text.
Mapping
= textMapping;
1146
accessor.
Mapping
= mapping;
1158
anyAccessor.
Mapping
= mapping;
1173
arrayAccessor.
Mapping
= arrayMapping;
1344
accessor.
Mapping
= GetDefaultMapping(TypeFlags.CanBeElementValue | TypeFlags.CanBeTextValue);
1356
accessor.
Mapping
= ((ArrayMapping)accessor.Mapping).TopLevelMapping;
1396
accessor.
Mapping
= mapping;
1450
xmlns.
Mapping
= xmlnsMapping;
1482
accessor.
Mapping
= mapping;
1517
accessor.
Mapping
= mapping;
System\Xml\Serialization\XmlSerializationReader.cs (1)
2989
element.
Mapping
= nullableMapping.BaseMapping;
System\Xml\Serialization\XmlSerializationReaderILGen.cs (1)
1336
element.
Mapping
= nullableMapping.BaseMapping;
System\Xml\Serialization\XmlSerializationWriter.cs (1)
2759
e.
Mapping
= ((NullableMapping)element.Mapping).BaseMapping;
System\Xml\Serialization\XmlSerializationWriterILGen.cs (1)
1869
e.
Mapping
= ((NullableMapping)element.Mapping).BaseMapping;
407 references to Mapping
System.Xml (407)
System\Xml\Serialization\CodeExporter.cs (2)
199
TypeKind kind = arrayMapping.Elements[0].
Mapping
.TypeDesc.Kind;
205
if (arrayMapping.Elements[i].Name != arrayMapping.Elements[i].
Mapping
.DefaultElementName) {
System\Xml\Serialization\Mappings.cs (9)
151
newAccessor.Mapping = this.
Mapping
;
529
hasSimpleContent = !hasElements && text != null && !text.
Mapping
.IsList;
543
if (!hasSimpleContent && text != null && !text.
Mapping
.TypeDesc.CanBeTextValue) {
544
throw new InvalidOperationException(Res.GetString(Res.XmlIllegalTypedTextAttribute, TypeDesc.FullName, text.Name, text.
Mapping
.TypeDesc.FullName));
648
int w1 = a1.
Mapping
.TypeDesc.Weight;
649
int w2 = a2.
Mapping
.TypeDesc.Weight;
701
if (element.
Mapping
is ArrayMapping) {
702
ArrayMapping arrayMapping = (ArrayMapping)element.
Mapping
;
709
return element.IsNullable && element.
Mapping
.TypeDesc.IsValueType;
System\Xml\Serialization\SoapCodeExporter.cs (3)
83
ExportType(element.
Mapping
);
210
TypeMapping mapping = (TypeMapping)element.
Mapping
;
266
ExportType(accessors[i].
Mapping
);
System\Xml\Serialization\SoapReflectionImporter.cs (7)
111
element.Name = element.
Mapping
.DefaultElementName;
112
element.Namespace = element.
Mapping
.Namespace == null ? defaultNamespace : element.
Mapping
.Namespace;
154
element.
Mapping
.TypeName = elementName;
155
element.Namespace = element.
Mapping
.Namespace == null ? ns : element.
Mapping
.Namespace;
447
itemTypeMapping = mapping.Elements[0].
Mapping
;
System\Xml\Serialization\SoapSchemaExporter.cs (5)
61
MembersMapping membersMapping = (MembersMapping)xmlMembersMapping.Accessor.
Mapping
;
68
ExportTypeMapping(memberMapping.Elements[0].
Mapping
, null);
212
XmlQualifiedName qname = ExportTypeMapping(mapping.Elements[0].
Mapping
, mapping.Namespace);
261
element.IsNillable = accessor.IsNullable || accessor.
Mapping
is NullableMapping;
263
element.SchemaTypeName = ExportTypeMapping(accessor.
Mapping
, accessor.Namespace);
System\Xml\Serialization\SoapSchemaImporter.cs (8)
145
if (member.Accessor.
Mapping
is StructMapping)
146
MakeDerived((StructMapping)member.Accessor.
Mapping
, baseType, baseTypeCanBeIndirect);
412
arrayMapping.TypeDesc = itemAccessor.
Mapping
.TypeDesc.CreateArrayTypeDesc();
413
arrayMapping.TypeName = "ArrayOf" + CodeIdentifier.MakePascal(itemAccessor.
Mapping
.TypeName);
465
arrayMapping.TypeDesc = itemAccessor.
Mapping
.TypeDesc.CreateArrayTypeDesc();
466
arrayMapping.TypeName = "ArrayOf" + CodeIdentifier.MakePascal(itemAccessor.
Mapping
.TypeName);
482
arrayMapping.TypeDesc = ((TypeMapping)itemAccessor.
Mapping
).TypeDesc.CreateArrayTypeDesc();
504
member.TypeDesc = ((TypeMapping)accessor.
Mapping
).TypeDesc;
System\Xml\Serialization\XmlCodeExporter.cs (13)
86
ExportType(mapping.Attribute.
Mapping
, Accessor.UnescapeName(mapping.Attribute.Name), mapping.Attribute.Namespace, null, false);
91
ExportType(element.
Mapping
, Accessor.UnescapeName(element.Name), element.Namespace, null, false);
95
ExportType(mapping.Text.
Mapping
, Accessor.UnescapeName(mapping.Text.Name), mapping.Text.Namespace, null, false);
102
ExportType(element.
Mapping
, Accessor.UnescapeName(element.Name), element.Namespace, element, true);
599
TypeMapping elementMapping = arrayElement.
Mapping
;
601
bool sameName = arrayElement.
Mapping
.TypeDesc.IsArray ? false : elementName == arrayElement.
Mapping
.TypeName;
623
TypeMapping mapping = (TypeMapping)attribute.
Mapping
;
642
TypeMapping mapping = (TypeMapping)member.Text.
Mapping
;
649
TypeMapping mapping = (TypeMapping)element.
Mapping
;
688
ExportElement(metadata, elemName, sameNs ? null : element.Namespace, ((TypeMapping)element.
Mapping
).TypeDesc, ((TypeMapping)element.
Mapping
).TypeDesc, element.IsNullable, defaultForm ? XmlSchemaForm.None : element.Form, member.SequenceId);
841
ExportType(accessor.
Mapping
, null, ns, null, false);
System\Xml\Serialization\XmlMemberMapping.cs (4)
74
get { return Accessor.
Mapping
!= null ? Accessor.
Mapping
.TypeName : String.Empty; }
82
get { return Accessor.
Mapping
!= null ? Accessor.
Mapping
.Namespace : null; }
System\Xml\Serialization\XmlMembersMapping.cs (3)
22
MembersMapping mapping = (MembersMapping)accessor.
Mapping
;
41
get { return Accessor.
Mapping
.TypeName; }
49
get { return Accessor.
Mapping
.Namespace; }
System\Xml\Serialization\XmlReflectionImporter.cs (50)
255
CheckNullable(element.IsNullable, model.TypeDesc, element.
Mapping
);
288
if (existing.
Mapping
== accessor.
Mapping
)
291
if (!(accessor.
Mapping
is MembersMapping) && !(existing.
Mapping
is MembersMapping)) {
292
if (accessor.
Mapping
.TypeDesc == existing.
Mapping
.TypeDesc
293
|| (existing.
Mapping
is NullableMapping && accessor.
Mapping
.TypeDesc == ((NullableMapping)existing.
Mapping
).BaseMapping.TypeDesc)
294
|| (accessor.
Mapping
is NullableMapping && ((NullableMapping)accessor.
Mapping
).BaseMapping.TypeDesc == existing.
Mapping
.TypeDesc))
306
if (accessor.
Mapping
is MembersMapping || existing.
Mapping
is MembersMapping)
309
if (accessor.
Mapping
is ArrayMapping) {
310
if (!(existing.
Mapping
is ArrayMapping)) {
311
throw new InvalidOperationException(Res.GetString(Res.XmlCannotReconcileAccessor, accessor.Name, accessor.Namespace, GetMappingName(existing.
Mapping
), GetMappingName(accessor.
Mapping
)));
313
ArrayMapping mapping = (ArrayMapping)accessor.
Mapping
;
314
ArrayMapping existingMapping = mapping.IsAnonymousType ? null : (ArrayMapping)types[existing.
Mapping
.TypeName, existing.
Mapping
.Namespace];
317
if (existingMapping == accessor.
Mapping
)
323
types[existing.
Mapping
.TypeName, existing.
Mapping
.Namespace] = mapping;
327
throw new InvalidOperationException(Res.GetString(Res.XmlCannotReconcileAttributeAccessor, accessor.Name, accessor.Namespace, GetMappingName(existing.
Mapping
), GetMappingName(accessor.
Mapping
)));
329
throw new InvalidOperationException(Res.GetString(Res.XmlCannotReconcileAccessor, accessor.Name, accessor.Namespace, GetMappingName(existing.
Mapping
), GetMappingName(accessor.
Mapping
)));
764
if (!member.Text.
Mapping
.TypeDesc.CanBeTextValue && member.Text.
Mapping
.IsList)
765
throw new InvalidOperationException(Res.GetString(Res.XmlIllegalTypedTextAttribute, typeName, member.Text.Name, member.Text.
Mapping
.TypeDesc.FullName));
889
itemTypeMapping = element.
Mapping
;
1308
arrayItemElement.Name = xmlArrayItem.ElementName.Length == 0 ? arrayItemElement.
Mapping
.DefaultElementName : XmlConvert.EncodeLocalName(xmlArrayItem.ElementName);
1312
CheckNullable(arrayItemElement.IsNullable, targetTypeDesc, arrayItemElement.
Mapping
);
1353
CheckChoiceIdentifierMapping((EnumMapping)accessor.ChoiceIdentifier.
Mapping
);
1412
if (!(text.
Mapping
is SpecialMapping) && targetTypeDesc != typeScope.GetTypeDesc(typeof(string)))
1433
element.Name = xmlElement.ElementName.Length == 0 ? element.
Mapping
.DefaultElementName : XmlConvert.EncodeLocalName(xmlElement.ElementName);
1442
CheckNullable(element.IsNullable, targetTypeDesc, element.
Mapping
);
1485
CheckNullable(element.IsNullable, targetTypeDesc, element.
Mapping
);
1520
CheckNullable(arrayElement.IsNullable, accessor.TypeDesc, arrayElement.
Mapping
);
1586
if (element.
Mapping
.TypeDesc.Kind == TypeKind.Node) {
1596
CheckNullable(element.IsNullable, accessor.TypeDesc, element.
Mapping
);
1644
element.Name = xmlElement.ElementName.Length == 0 ? element.
Mapping
.DefaultElementName : XmlConvert.EncodeLocalName(xmlElement.ElementName);
1652
CheckNullable(element.IsNullable, targetTypeDesc, element.
Mapping
);
1700
CheckNullable(element.IsNullable, targetTypeDesc, element.
Mapping
);
1720
if (accessor.TypeDesc.IsArrayLike && accessor.Elements.Length > 0 && !(accessor.Elements[0].
Mapping
is ArrayMapping))
1733
EnumMapping choiceMapping = (EnumMapping)accessor.ChoiceIdentifier.
Mapping
;
1761
throw new InvalidOperationException(Res.GetString(Res.XmlChoiceMissingAnyValue, accessor.ChoiceIdentifier.
Mapping
.TypeDesc.FullName));
1766
throw new InvalidOperationException(Res.GetString(Res.XmlChoiceMissingValue, accessor.ChoiceIdentifier.
Mapping
.TypeDesc.FullName, id, element.Name, element.Namespace));
System\Xml\Serialization\XmlSchemaExporter.cs (19)
57
MembersMapping mapping = (MembersMapping)xmlMembersMapping.Accessor.
Mapping
;
58
if (mapping.Members.Length == 1 && mapping.Members[0].Elements[0].
Mapping
is SpecialMapping) {
59
SpecialMapping special = (SpecialMapping)mapping.Members[0].Elements[0].
Mapping
;
85
MembersMapping mapping = (MembersMapping)xmlMembersMapping.Accessor.
Mapping
;
99
if (member.TypeDesc.IsArrayLike && !(member.Elements[0].
Mapping
is ArrayMapping))
106
ExportMapping(member.Elements[0].
Mapping
, member.Elements[0].Namespace, member.Elements[0].Any);
228
if (!accessor.
Mapping
.IncludeInSchema && !accessor.
Mapping
.TypeDesc.IsRoot) {
241
ExportElementMapping(element, accessor.
Mapping
, accessor.Namespace, accessor.Any);
658
if (!accessor.HasDefault && !valueTypeOptional && accessor.
Mapping
.TypeDesc.IsValueType) {
686
if (accessor.
Mapping
is PrimitiveMapping) {
687
PrimitiveMapping pm = (PrimitiveMapping)accessor.
Mapping
;
710
else if (!(accessor.
Mapping
is SpecialMapping))
714
attribute.DefaultValue = ExportDefaultValue(accessor.
Mapping
, accessor.Default);
730
int minOccurs = repeats || accessor.HasDefault || (!accessor.IsNullable && !accessor.
Mapping
.TypeDesc.IsValueType) || valueTypeOptional ? 0 : 1;
738
element.DefaultValue = ExportDefaultValue(accessor.
Mapping
, accessor.Default);
756
ExportElementMapping(element, (TypeMapping)accessor.
Mapping
, accessor.Namespace, accessor.Any);
934
textMapping = member.Text.
Mapping
;
938
!(member.Elements.Length == 1 && member.Elements[0].
Mapping
is ArrayMapping);
System\Xml\Serialization\XmlSchemaImporter.cs (48)
93
if (element.
Mapping
is StructMapping) {
94
MakeDerived((StructMapping)element.
Mapping
, baseType, baseTypeCanBeIndirect);
97
if (element.
Mapping
is ArrayMapping) {
99
element.Mapping = ((ArrayMapping)element.
Mapping
).TopLevelMapping;
100
MakeDerived((StructMapping)element.
Mapping
, baseType, baseTypeCanBeIndirect);
146
if (accessor.
Mapping
is StructMapping) {
147
MakeDerived((StructMapping)accessor.
Mapping
, baseType, baseTypeCanBeIndirect);
150
if (accessor.
Mapping
is ArrayMapping) {
152
accessor.Mapping = ((ArrayMapping)accessor.
Mapping
).TopLevelMapping;
153
MakeDerived((StructMapping)accessor.
Mapping
, baseType, baseTypeCanBeIndirect);
234
if (baseType != null && accessor.
Mapping
is StructMapping)
235
MakeDerived((StructMapping)accessor.
Mapping
, baseType, baseTypeCanBeIndirect);
240
member.TypeDesc = accessor.
Mapping
.TypeDesc;
291
if (element.IsMultipleOccurrence && topAccessor.
Mapping
is ArrayMapping) {
294
refAccessor.
Mapping
.ReferencedByElement = true;
773
string tdFullName = element.
Mapping
.TypeDesc.FullName;
785
ArrayMapping arrayMapping = element.
Mapping
as ArrayMapping;
791
element.
Mapping
.ReferencedByTopLevelElement = false;
792
element.
Mapping
.ReferencedByElement = true;
806
typeDescs[i] = ((ElementAccessor)enumerator.Current).
Mapping
.TypeDesc;
828
ConstantMapping[] constants = ((EnumMapping)member.ChoiceIdentifier.
Mapping
).Constants;
836
choiceIdentifier.TypeDesc = member.ChoiceIdentifier.
Mapping
.TypeDesc.CreateArrayTypeDesc();
839
choiceIdentifier.TypeDesc = member.ChoiceIdentifier.
Mapping
.TypeDesc;
847
choiceAccessor.Mapping = member.ChoiceIdentifier.
Mapping
;
865
TypeMapping itemMapping = item.
Mapping
;
873
if (item.
Mapping
.TypeDesc != null)
875
if (item.IsNullable != item.
Mapping
.TypeDesc.IsNullable)
878
if (item.
Mapping
.TypeDesc.IsAmbiguousDataType)
953
if (scopeElement.
Mapping
.TypeDesc != element.
Mapping
.TypeDesc) {
1075
member.TypeDesc = accessor.
Mapping
.TypeDesc.CreateArrayTypeDesc();
1080
PrimitiveMapping pm = (PrimitiveMapping)accessor.
Mapping
;
1082
member.TypeDesc = accessor.
Mapping
.TypeDesc.CreateArrayTypeDesc();
1086
member.TypeDesc = accessor.
Mapping
.TypeDesc;
1102
member.TypeDesc = ((TypeMapping)accessors[0].
Mapping
).TypeDesc;
1229
arrayMapping.TypeDesc = ((TypeMapping)itemAccessor.
Mapping
).TypeDesc.CreateArrayTypeDesc();
1230
arrayMapping.TypeName = (type.Name == null || type.Name.Length == 0) ? "ArrayOf" + CodeIdentifier.MakePascal(itemAccessor.
Mapping
.TypeDesc.Name) : type.Name;
1343
if (accessor.
Mapping
.IsList) {
1345
member.TypeDesc = accessor.
Mapping
.TypeDesc;
1348
member.TypeDesc = accessor.
Mapping
.TypeDesc;
1355
if (!allowUnboundedElements && accessor.
Mapping
is ArrayMapping) {
1356
accessor.Mapping = ((ArrayMapping)accessor.
Mapping
).TopLevelMapping;
1357
accessor.
Mapping
.ReferencedByTopLevelElement = false;
1358
accessor.
Mapping
.ReferencedByElement = true;
1360
member.TypeDesc = accessor.
Mapping
.TypeDesc.CreateArrayTypeDesc();
1382
member.TypeDesc = accessor.IsList ? accessor.
Mapping
.TypeDesc.CreateArrayTypeDesc() : accessor.
Mapping
.TypeDesc;
1404
member.TypeDesc = ((TypeMapping)accessor.
Mapping
).TypeDesc;
System\Xml\Serialization\XmlSerializationGeneratedCode.cs (2)
250
string serializerName = CodeIdentifier.MakeValid(Accessor.UnescapeName(mapping.Accessor.
Mapping
.TypeDesc.Name));
345
Type type = xmlMappings[i].Accessor.
Mapping
.TypeDesc.Type;
System\Xml\Serialization\XmlSerializationILGen.cs (2)
296
string serializerName = CodeIdentifier.MakeValid(Accessor.UnescapeName(mapping.Accessor.
Mapping
.TypeDesc.Name));
430
Type type = xmlMappings[i].Accessor.
Mapping
.TypeDesc.Type;
System\Xml\Serialization\XmlSerializationReader.cs (62)
2036
bool choiceUseReflection = mapping.ChoiceIdentifier.
Mapping
.TypeDesc.UseReflection;
2037
string choiceTypeFullName = mapping.ChoiceIdentifier.
Mapping
.TypeDesc.CSharpName;
2042
this.choiceArraySource = init + outerClass.RaCodeGen.GetStringForArrayMember(a, c + "++", mapping.ChoiceIdentifier.
Mapping
.TypeDesc);
2332
MemberMapping[] mappings = ((MembersMapping)element.
Mapping
).Members;
2333
bool hasWrapperElement = ((MembersMapping)element.
Mapping
).HasWrapperElement;
2405
else if (mapping.TypeDesc.IsArrayLike && !(mapping.Elements.Length == 1 && mapping.Elements[0].
Mapping
is ArrayMapping)) {
2490
MembersMapping membersMapping = (MembersMapping)element.
Mapping
;
2617
TypeMapping mapping = element.
Mapping
;
3124
if (mapping.Attribute == null && mapping.Elements.Length == 1 && mapping.Elements[0].
Mapping
is ArrayMapping) {
3135
if (mapping.TypeDesc.IsArrayLike && !(mapping.Elements.Length == 1 && mapping.Elements[0].
Mapping
is ArrayMapping)) {
3541
if (attribute.
Mapping
is SpecialMapping) {
3542
SpecialMapping special = (SpecialMapping)attribute.
Mapping
;
3577
WritePrimitive(attribute.
Mapping
, "vals[i]");
3585
WritePrimitive(attribute.
Mapping
, attribute.IsList ? "vals[i]" : "Reader.Value");
3607
TypeMapping mapping = member.Mapping.Elements[0].
Mapping
;
3651
WriteArrayLocalDecl(member.Mapping.ChoiceIdentifier.
Mapping
.TypeDesc.CSharpName+"[]",
3653
member.Mapping.ChoiceIdentifier.
Mapping
.TypeDesc);
3791
if (text.
Mapping
is SpecialMapping) {
3792
SpecialMapping special = (SpecialMapping)text.
Mapping
;
3806
if (text.
Mapping
.TypeDesc.CollapseWhitespace) {
3814
if (text.
Mapping
.TypeDesc == StringTypeDesc || text.
Mapping
.TypeDesc.FormatterName == "String") {
3816
if (text.
Mapping
.TypeDesc.CollapseWhitespace)
3826
WritePrimitive(text.
Mapping
, "Reader.ReadString()");
3926
if (e.
Mapping
is NullableMapping) {
3927
TypeDesc td = ((NullableMapping)e.
Mapping
).BaseMapping.TypeDesc;
3931
Writer.Write(RaCodeGen.GetStringForTypeof(e.
Mapping
.TypeDesc.CSharpName, e.
Mapping
.TypeDesc.UseReflection));
3952
if (e.
Mapping
.TypeDesc.IsValueType || e.
Mapping
is NullableMapping) {
3958
if (e.
Mapping
is NullableMapping) {
3960
TypeDesc td = ((NullableMapping)e.
Mapping
).BaseMapping.TypeDesc;
3961
Writer.Write(RaCodeGen.GetStringForCreateInstance(e.
Mapping
.TypeDesc.CSharpName, e.
Mapping
.TypeDesc.UseReflection, false, true, "(" + td.CSharpName + ")" + checkTypeSource));
3964
WriteSourceBeginTyped(member.ArraySource, e.
Mapping
.TypeDesc);
3969
if (e.
Mapping
.TypeDesc.IsValueType) {
4102
bool choiceUseReflection = member.Mapping.ChoiceIdentifier.
Mapping
.TypeDesc.UseReflection;
4103
string choiceTypeName = member.Mapping.ChoiceIdentifier.
Mapping
.TypeDesc.CSharpName;
4253
if (element.
Mapping
is ArrayMapping) {
4254
WriteArray(source, arrayName, (ArrayMapping)element.
Mapping
, readOnly, element.IsNullable, fixupIndex);
4256
else if (element.
Mapping
is NullableMapping) {
4257
string methodName = ReferenceMapping(element.
Mapping
);
4268
else if (!element.
Mapping
.IsSoap && (element.
Mapping
is PrimitiveMapping)) {
4273
if (element.
Mapping
.TypeDesc.IsValueType) {
4274
Writer.Write(RaCodeGen.GetStringForCreateInstance(element.
Mapping
.TypeDesc.CSharpName, element.
Mapping
.TypeDesc.UseReflection, false, false));
4285
if (element.Default != null && element.Default != DBNull.Value && element.
Mapping
.TypeDesc.IsValueType) {
4299
if (element.
Mapping
.TypeDesc.Type == typeof(TimeSpan) && LocalAppContextSwitches.EnableTimeSpanSerialization)
4313
WritePrimitive(element.
Mapping
, "Reader.ReadElementString()");
4322
if (element.
Mapping
.TypeDesc == QnameTypeDesc)
4326
switch (element.
Mapping
.TypeDesc.FormatterName) {
4335
WritePrimitive(element.
Mapping
, readFunc);
4345
else if (element.
Mapping
is StructMapping || (element.
Mapping
.IsSoap && element.
Mapping
is PrimitiveMapping)) {
4346
TypeMapping mapping = element.
Mapping
;
4409
else if (element.
Mapping
is SpecialMapping) {
4410
SpecialMapping special = (SpecialMapping)element.
Mapping
;
4422
SerializableMapping sm = (SerializableMapping)element.
Mapping
;
4466
string enumTypeName = choice.
Mapping
.TypeDesc.CSharpName;
4470
Writer.Write(RaCodeGen.GetStringForEnumMember(enumTypeName, choice.MemberIds[elementIndex], choice.
Mapping
.TypeDesc.UseReflection));
System\Xml\Serialization\XmlSerializationReaderILGen.cs (51)
104
string choiceTypeFullName = mapping.ChoiceIdentifier.
Mapping
.TypeDesc.CSharpName;
109
this.choiceArraySource = init + outerClass.RaCodeGen.GetStringForArrayMember(a, c + "++", mapping.ChoiceIdentifier.
Mapping
.TypeDesc);
402
MemberMapping[] mappings = ((MembersMapping)element.
Mapping
).Members;
403
bool hasWrapperElement = ((MembersMapping)element.
Mapping
).HasWrapperElement;
496
else if (mapping.TypeDesc.IsArrayLike && !(mapping.Elements.Length == 1 && mapping.Elements[0].
Mapping
is ArrayMapping)) {
644
TypeMapping mapping = element.
Mapping
;
1598
if (mapping.Attribute == null && mapping.Elements.Length == 1 && mapping.Elements[0].
Mapping
is ArrayMapping) {
1609
if (mapping.TypeDesc.IsArrayLike && !(mapping.Elements.Length == 1 && mapping.Elements[0].
Mapping
is ArrayMapping)) {
2095
if (attribute.
Mapping
is SpecialMapping) {
2096
SpecialMapping special = (SpecialMapping)attribute.
Mapping
;
2162
WritePrimitive(attribute.
Mapping
, "vals[i]");
2168
WritePrimitive(attribute.
Mapping
, attribute.IsList ? "vals[i]" : "Reader.Value");
2198
WriteArrayLocalDecl(member.Mapping.ChoiceIdentifier.
Mapping
.TypeDesc.CSharpName + "[]",
2200
member.Mapping.ChoiceIdentifier.
Mapping
.TypeDesc);
2370
if (text.
Mapping
is SpecialMapping) {
2371
SpecialMapping special = (SpecialMapping)text.
Mapping
;
2418
if (text.
Mapping
.TypeDesc.CollapseWhitespace) {
2440
if (text.
Mapping
.TypeDesc.CollapseWhitespace) {
2452
if (text.
Mapping
.TypeDesc == StringTypeDesc || text.
Mapping
.TypeDesc.FormatterName == "String") {
2463
ilg.Ldc(text.
Mapping
.TypeDesc.CollapseWhitespace);
2472
WritePrimitive(text.
Mapping
, "Reader.ReadString()");
2475
WriteSourceEnd(member.ArraySource, text.
Mapping
.TypeDesc.Type);
2694
ilg.Ldc(member.Mapping.ChoiceIdentifier.
Mapping
.TypeDesc.Type);
2697
ilg.ConvertValue(XmlSerializationReader_ShrinkArray.ReturnType, member.Mapping.ChoiceIdentifier.
Mapping
.TypeDesc.Type.MakeArrayType());
2698
WriteSourceEnd(member.ChoiceSource, member.Mapping.ChoiceIdentifier.
Mapping
.TypeDesc.Type.MakeArrayType());
2989
if (element.
Mapping
is ArrayMapping) {
2990
WriteArray(source, arrayName, (ArrayMapping)element.
Mapping
, readOnly, element.IsNullable, fixupIndex, elementIndex);
2992
else if (element.
Mapping
is NullableMapping) {
2993
string methodName = ReferenceMapping(element.
Mapping
);
3005
element.
Mapping
.TypeDesc.Type,
3009
WriteSourceEnd(source, element.
Mapping
.TypeDesc.Type);
3011
else if (element.
Mapping
is PrimitiveMapping) {
3025
if (element.
Mapping
.TypeDesc.IsValueType) {
3031
WriteSourceEnd(source, element.
Mapping
.TypeDesc.Type);
3035
if (element.Default != null && element.Default != DBNull.Value && element.
Mapping
.TypeDesc.IsValueType) {
3071
if (LocalAppContextSwitches.EnableTimeSpanSerialization && element.
Mapping
.TypeDesc.Type == typeof(TimeSpan))
3110
WriteSourceEnd(source, element.
Mapping
.TypeDesc.Type);
3113
WritePrimitive(element.
Mapping
, "Reader.ReadElementString()");
3114
WriteSourceEnd(source, element.
Mapping
.TypeDesc.Type);
3120
if (element.
Mapping
.TypeDesc == QnameTypeDesc) {
3133
switch (element.
Mapping
.TypeDesc.FormatterName) {
3142
WritePrimitive(element.
Mapping
, readFunc);
3144
WriteSourceEnd(source, element.
Mapping
.TypeDesc.Type);
3150
else if (element.
Mapping
is StructMapping) {
3151
TypeMapping mapping = element.
Mapping
;
3202
else if (element.
Mapping
is SpecialMapping) {
3203
SpecialMapping special = (SpecialMapping)element.
Mapping
;
3224
SerializableMapping sm = (SerializableMapping)element.
Mapping
;
3292
RaCodeGen.ILGenForEnumMember(ilg, choice.
Mapping
.TypeDesc.Type, choice.MemberIds[elementIndex]);
3293
WriteSourceEnd(choiceSource, choice.
Mapping
.TypeDesc.Type);
System\Xml\Serialization\XmlSerializationWriter.cs (60)
1605
MembersMapping mapping = (MembersMapping)element.
Mapping
;
1730
if (member.ChoiceIdentifier.
Mapping
.TypeDesc.UseReflection)
1790
TypeMapping mapping = element.
Mapping
;
2307
if (attribute.
Mapping
is EnumMapping)
2308
WriteEnumValue((EnumMapping)attribute.
Mapping
, "ai");
2354
if (attribute.
Mapping
is SpecialMapping) {
2355
SpecialMapping special = (SpecialMapping)attribute.
Mapping
;
2367
TypeDesc typeDesc = attribute.
Mapping
.TypeDesc;
2369
WritePrimitive("WriteAttribute", attribute.Name, attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : "", attribute.Default, source, attribute.
Mapping
, false, false, false);
2375
!(elements.Length == 1 && elements[0].
Mapping
is ArrayMapping))
2394
bool choiceUseReflection = choice.
Mapping
.TypeDesc.UseReflection;
2395
string choiceFullName = choice.
Mapping
.TypeDesc.CSharpName;
2396
WriteArrayLocalDecl(choiceFullName+"[]", "c", choiceSource, choice.
Mapping
.TypeDesc);
2401
WriteQuotedCSharpString(choice.
Mapping
.TypeDesc.FullName);
2492
string choiceFullName = choice.
Mapping
.TypeDesc.CSharpName;
2493
WriteLocalDecl(choiceFullName, choiceName+"i", RaCodeGen.GetStringForArrayMember(choiceName, "i"+arrayName, choice.
Mapping
.TypeDesc), choice.
Mapping
.TypeDesc.UseReflection);
2512
TypeDesc td = elements[0].IsUnbounded ? elements[0].
Mapping
.TypeDesc.CreateArrayTypeDesc() : elements[0].
Mapping
.TypeDesc;
2513
if (!elements[0].Any && !elements[0].
Mapping
.TypeDesc.UseReflection && !elements[0].
Mapping
.TypeDesc.IsOptionalValue)
2529
string enumTypeName = choice == null ? null : choice.
Mapping
.TypeDesc.FullName;
2542
bool useReflection = element.
Mapping
.TypeDesc.UseReflection;
2543
string fullTypeName = element.
Mapping
.TypeDesc.CSharpName;
2544
bool enumUseReflection = choice.
Mapping
.TypeDesc.UseReflection;
2545
string enumFullName = (enumUseReflection?"":enumTypeName + ".@") + FindChoiceEnumValue(element, (EnumMapping)choice.
Mapping
, enumUseReflection);
2561
WriteChoiceTypeCheck(source, fullTypeName, useReflection, choice, enumFullName, element.
Mapping
.TypeDesc);
2571
bool useReflection = element.
Mapping
.TypeDesc.UseReflection;
2572
TypeDesc td = element.IsUnbounded ? element.
Mapping
.TypeDesc.CreateArrayTypeDesc() : element.
Mapping
.TypeDesc;
2614
bool useReflection = element.
Mapping
.TypeDesc.UseReflection;
2616
bool enumUseReflection = choice.
Mapping
.TypeDesc.UseReflection;
2617
enumFullName = (enumUseReflection?"":enumTypeName + ".@") + FindChoiceEnumValue(element, (EnumMapping)choice.
Mapping
, enumUseReflection);
2675
bool useReflection = text.
Mapping
.TypeDesc.UseReflection;
2676
string fullTypeName = text.
Mapping
.TypeDesc.CSharpName;
2722
if (text.
Mapping
is PrimitiveMapping) {
2723
PrimitiveMapping mapping = (PrimitiveMapping)text.
Mapping
;
2725
if (text.
Mapping
is EnumMapping) {
2726
WriteEnumValue((EnumMapping)text.
Mapping
, source);
2733
else if (text.
Mapping
is SpecialMapping) {
2734
SpecialMapping mapping = (SpecialMapping)text.
Mapping
;
2747
string name = writeAccessor ? element.Name : element.
Mapping
.TypeName;
2748
string ns = element.Any && element.Name.Length == 0 ? null : (element.Form == XmlSchemaForm.Qualified ? (writeAccessor ? element.Namespace : element.
Mapping
.Namespace) : "");
2749
if (element.
Mapping
is NullableMapping) {
2754
string fullTypeName = element.
Mapping
.TypeDesc.BaseTypeDesc.CSharpName;
2756
if (!element.
Mapping
.TypeDesc.BaseTypeDesc.UseReflection)
2759
e.Mapping = ((NullableMapping)element.
Mapping
).BaseMapping;
2771
else if (element.
Mapping
is ArrayMapping) {
2772
ArrayMapping mapping = (ArrayMapping)element.
Mapping
;
2872
else if (element.
Mapping
is EnumMapping) {
2873
if (element.
Mapping
.IsSoap) {
2874
string methodName = (string)MethodNames[element.
Mapping
];
2887
WritePrimitive("WriteElementString", name, ns, element.Default, source, element.
Mapping
, false, true, element.IsNullable);
2890
else if (element.
Mapping
is PrimitiveMapping) {
2891
PrimitiveMapping mapping = (PrimitiveMapping)element.
Mapping
;
2901
else if (element.
Mapping
is StructMapping) {
2902
StructMapping mapping = (StructMapping)element.
Mapping
;
2947
else if (element.
Mapping
is SpecialMapping) {
2948
SpecialMapping mapping = (SpecialMapping)element.
Mapping
;
2954
if (element.
Mapping
is SerializableMapping) {
System\Xml\Serialization\XmlSerializationWriterILGen.cs (58)
323
MembersMapping mapping = (MembersMapping)element.
Mapping
;
502
TypeMapping mapping = element.
Mapping
;
1227
if (attribute.
Mapping
is EnumMapping)
1228
WriteEnumValue((EnumMapping)attribute.
Mapping
, new SourceInfo(aiVar, aiVar, null, arrayElementTypeDesc.Type, ilg), out argType);
1324
if (attribute.
Mapping
is SpecialMapping) {
1325
SpecialMapping special = (SpecialMapping)attribute.
Mapping
;
1345
TypeDesc typeDesc = attribute.
Mapping
.TypeDesc;
1347
WritePrimitive("WriteAttribute", attribute.Name, attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : "", GetConvertedDefaultValue(source.Type, attribute.Default), source, attribute.
Mapping
, false, false, false);
1366
!(elements.Length == 1 && elements[0].
Mapping
is ArrayMapping))
1388
string choiceFullName = choice.
Mapping
.TypeDesc.CSharpName;
1390
cName = "c" + choice.
Mapping
.TypeDesc.Name;
1391
WriteArrayLocalDecl(choiceFullName + "[]", cName, choiceSourceInfo, choice.
Mapping
.TypeDesc);
1417
ilg.Ldstr(choice.
Mapping
.TypeDesc.FullName);
1507
WriteLocalDecl(choiceName + "i", RaCodeGen.GetStringForArrayMember(choiceName, iPlusArrayName, choice.
Mapping
.TypeDesc), choice.
Mapping
.TypeDesc.Type);
1521
TypeDesc td = elements[0].IsUnbounded ? elements[0].
Mapping
.TypeDesc.CreateArrayTypeDesc() : elements[0].
Mapping
.TypeDesc;
1522
if (!elements[0].Any && !elements[0].
Mapping
.TypeDesc.IsOptionalValue)
1538
string enumTypeName = choice == null ? null : choice.
Mapping
.TypeDesc.FullName;
1551
string fullTypeName = element.
Mapping
.TypeDesc.CSharpName;
1553
string enumFullName = enumTypeName + ".@" + FindChoiceEnumValue(element, (EnumMapping)choice.
Mapping
, out enumValue);
1557
ILGenLoad(enumSource, choice == null ? null : choice.
Mapping
.TypeDesc.Type);
1574
WriteChoiceTypeCheck(source, fullTypeName, choice, enumFullName, element.
Mapping
.TypeDesc);
1577
castedSource = source.CastTo(element.
Mapping
.TypeDesc);
1581
TypeDesc td = element.IsUnbounded ? element.
Mapping
.TypeDesc.CreateArrayTypeDesc() : element.
Mapping
.TypeDesc;
1628
enumFullName = enumTypeName + ".@" + FindChoiceEnumValue(element, (EnumMapping)choice.
Mapping
, out enumValue);
1631
ILGenLoad(enumSource, choice == null ? null : choice.
Mapping
.TypeDesc.Type);
1751
string fullTypeName = text.
Mapping
.TypeDesc.CSharpName;
1754
WriteInstanceOf(source, text.
Mapping
.TypeDesc.Type);
1756
SourceInfo castedSource = source.CastTo(text.
Mapping
.TypeDesc);
1760
SourceInfo castedSource = source.CastTo(text.
Mapping
.TypeDesc);
1797
if (text.
Mapping
is PrimitiveMapping) {
1798
PrimitiveMapping mapping = (PrimitiveMapping)text.
Mapping
;
1801
if (text.
Mapping
is EnumMapping) {
1802
WriteEnumValue((EnumMapping)text.
Mapping
, source, out argType);
1816
else if (text.
Mapping
is SpecialMapping) {
1817
SpecialMapping mapping = (SpecialMapping)text.
Mapping
;
1846
string name = writeAccessor ? element.Name : element.
Mapping
.TypeName;
1847
string ns = element.Any && element.Name.Length == 0 ? null : (element.Form == XmlSchemaForm.Qualified ? (writeAccessor ? element.Namespace : element.
Mapping
.Namespace) : "");
1848
if (element.
Mapping
is NullableMapping) {
1849
if (source.Type == element.
Mapping
.TypeDesc.Type) {
1850
MethodInfo Nullable_get_HasValue = element.
Mapping
.TypeDesc.Type.GetMethod(
1857
source.LoadAddress(element.
Mapping
.TypeDesc.Type);
1866
string fullTypeName = element.
Mapping
.TypeDesc.BaseTypeDesc.CSharpName;
1867
SourceInfo castedSource = source.CastTo(element.
Mapping
.TypeDesc.BaseTypeDesc);
1869
e.Mapping = ((NullableMapping)element.
Mapping
).BaseMapping;
1877
else if (element.
Mapping
is ArrayMapping) {
1878
ArrayMapping mapping = (ArrayMapping)element.
Mapping
;
1910
else if (element.
Mapping
is EnumMapping) {
1911
WritePrimitive("WriteElementString", name, ns, element.Default, source, element.
Mapping
, false, true, element.IsNullable);
1913
else if (element.
Mapping
is PrimitiveMapping) {
1914
PrimitiveMapping mapping = (PrimitiveMapping)element.
Mapping
;
1923
else if (element.
Mapping
is StructMapping) {
1924
StructMapping mapping = (StructMapping)element.
Mapping
;
1953
else if (element.
Mapping
is SpecialMapping) {
1954
SpecialMapping mapping = (SpecialMapping)element.
Mapping
;
1959
if (element.
Mapping
is SerializableMapping) {
System\Xml\Serialization\XmlTypeMapping.cs (1)
23
get { return Accessor.
Mapping
; }