2 writes to ChoiceIdentifier
System.Private.Xml (2)
System\Xml\Serialization\XmlReflectionImporter.cs (1)
1562
accessor.
ChoiceIdentifier
= new ChoiceIdentifierAccessor();
System\Xml\Serialization\XmlSchemaImporter.cs (1)
842
member.
ChoiceIdentifier
= new ChoiceIdentifierAccessor();
88 references to ChoiceIdentifier
System.Private.Xml (88)
System\Xml\Serialization\ReflectionXmlSerializationReader.cs (2)
1132
if (memberMapping.
ChoiceIdentifier
!= null)
1695
ChoiceIdentifierAccessor? choice = mapping.
ChoiceIdentifier
;
System\Xml\Serialization\ReflectionXmlSerializationWriter.cs (6)
636
if (m.
ChoiceIdentifier
!= null)
638
choiceSource = GetMemberValue(o!, m.
ChoiceIdentifier
.MemberName!);
642
WriteMember(memberValue, choiceSource, m.ElementsSortedByDerivation!, m.Text, m.
ChoiceIdentifier
, m.TypeDesc!, true);
1270
if (member.
ChoiceIdentifier
!= null)
1274
if (mapping.Members[j].Name == member.
ChoiceIdentifier
.MemberName)
1288
WriteMember(source, enumSource, member.ElementsSortedByDerivation!, member.Text, member.
ChoiceIdentifier
, member.TypeDesc!, writeAccessors || hasWrapperElement);
System\Xml\Serialization\Types.cs (3)
1112
if (mappings[i].
ChoiceIdentifier
!= null)
1113
memberInfos[mappings[i].
ChoiceIdentifier
!.MemberName!] = mappings[i].
ChoiceIdentifier
!.MemberInfo!;
System\Xml\Serialization\XmlReflectionImporter.cs (11)
1563
accessor.
ChoiceIdentifier
.MemberName = a.XmlChoiceIdentifier.MemberName;
1564
accessor.
ChoiceIdentifier
.MemberInfo = a.XmlChoiceIdentifier.GetMemberInfo();
1565
accessor.
ChoiceIdentifier
.Mapping = ImportTypeMapping(_modelScope.GetTypeModel(choiceIdentifierType!), ns, ImportContext.Element, string.Empty, null, limiter);
1566
CheckChoiceIdentifierMapping((EnumMapping)accessor.
ChoiceIdentifier
.Mapping);
1984
if (accessor.
ChoiceIdentifier
!= null)
1987
accessor.
ChoiceIdentifier
.MemberIds = new string[accessor.Elements.Length];
1992
EnumMapping choiceMapping = (EnumMapping)accessor.
ChoiceIdentifier
.Mapping!;
2002
accessor.
ChoiceIdentifier
.MemberIds[i] = choiceMapping.Constants[j].Name;
2016
accessor.
ChoiceIdentifier
.MemberIds[i] = choiceMapping.Constants[j].Name;
2027
throw new InvalidOperationException(SR.Format(SR.XmlChoiceMissingAnyValue, accessor.
ChoiceIdentifier
.Mapping!.TypeDesc!.FullName));
2033
throw new InvalidOperationException(SR.Format(SR.XmlChoiceMissingValue, accessor.
ChoiceIdentifier
.Mapping!.TypeDesc!.FullName, id, element.Name, element.Namespace));
System\Xml\Serialization\XmlSchemaImporter.cs (12)
843
member.
ChoiceIdentifier
.MemberName = $"{member.Name}ElementName";
845
member.
ChoiceIdentifier
.Mapping = ImportEnumeratedChoice(member.Elements, ns, $"{member.Name}ChoiceType");
846
member.
ChoiceIdentifier
.MemberIds = new string[member.Elements.Length];
847
ConstantMapping[] constants = ((EnumMapping)member.
ChoiceIdentifier
.Mapping).Constants!;
850
member.
ChoiceIdentifier
.MemberIds[i] = constants[i].Name;
854
choiceIdentifier.Name = member.
ChoiceIdentifier
.MemberName;
857
choiceIdentifier.TypeDesc = member.
ChoiceIdentifier
.Mapping.TypeDesc!.CreateArrayTypeDesc();
861
choiceIdentifier.TypeDesc = member.
ChoiceIdentifier
.Mapping.TypeDesc;
869
choiceAccessor.Mapping = member.
ChoiceIdentifier
.Mapping;
874
choiceAccessor.Name = choiceIdentifier.Name = member.
ChoiceIdentifier
.MemberName = membersScope.AddUnique(member.
ChoiceIdentifier
.MemberName, choiceIdentifier);
1293
if (choiceMember.
ChoiceIdentifier
!= null) return null;
System\Xml\Serialization\XmlSerializationReader.cs (18)
2125
if (mapping.
ChoiceIdentifier
!= null)
2131
bool choiceUseReflection = mapping.
ChoiceIdentifier
.Mapping!.TypeDesc!.UseReflection;
2132
string choiceTypeFullName = mapping.
ChoiceIdentifier
.Mapping.TypeDesc.CSharpName;
2136
_choiceArraySource = init + outerClass.RaCodeGen.GetStringForArrayMember(a, $"{c}++", mapping.
ChoiceIdentifier
.Mapping.TypeDesc);
2447
if (member.
ChoiceIdentifier
!= null)
2451
if (mappings[j].Name == member.
ChoiceIdentifier
.MemberName)
2459
if (choiceSource == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, "Can not find " + member.
ChoiceIdentifier
.MemberName + " in the members mapping."));
2468
if (mapping.
ChoiceIdentifier
== null) return "";
2469
CodeIdentifier.CheckValidIdentifier(mapping.
ChoiceIdentifier
.MemberName);
2470
return RaCodeGen.GetStringForMember(parent, mapping.
ChoiceIdentifier
.MemberName, parentTypeDesc);
3919
if (member.Mapping.
ChoiceIdentifier
!= null)
3921
WriteArrayLocalDecl($"{member.Mapping.
ChoiceIdentifier
.Mapping!.TypeDesc!.CSharpName}[]",
3923
member.Mapping.
ChoiceIdentifier
.Mapping.TypeDesc);
4161
WriteElement(anyElement.ArraySource, anyElement.ArrayName, anyElement.ChoiceArraySource, element, anyElement.Mapping.
ChoiceIdentifier
, anyElement.Mapping.CheckSpecified == SpecifiedAccessor.ReadWrite ? anyElement.CheckSpecifiedSource : null, false, false, -1, i);
4205
ChoiceIdentifierAccessor? choice = member.Mapping.
ChoiceIdentifier
;
4454
if (member.Mapping.
ChoiceIdentifier
!= null)
4460
bool choiceUseReflection = member.Mapping.
ChoiceIdentifier
.Mapping!.TypeDesc!.UseReflection;
4461
string choiceTypeName = member.Mapping.
ChoiceIdentifier
.Mapping.TypeDesc.CSharpName;
System\Xml\Serialization\XmlSerializationReaderILGen.cs (17)
87
if (mapping.
ChoiceIdentifier
!= null)
93
string choiceTypeFullName = mapping.
ChoiceIdentifier
.Mapping!.TypeDesc!.CSharpName;
357
if (member.
ChoiceIdentifier
!= null)
361
if (mappings[j].Name == member.
ChoiceIdentifier
.MemberName)
369
if (choiceSource == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, "Can not find " + member.
ChoiceIdentifier
.MemberName + " in the members mapping."));
378
if (mapping.
ChoiceIdentifier
== null) return "";
379
CodeIdentifier.CheckValidIdentifier(mapping.
ChoiceIdentifier
.MemberName);
380
return ReflectionAwareILGen.GetStringForMember(parent, mapping.
ChoiceIdentifier
.MemberName);
2141
if (member.Mapping.
ChoiceIdentifier
!= null)
2143
WriteArrayLocalDecl($"{member.Mapping.
ChoiceIdentifier
.Mapping!.TypeDesc!.CSharpName}[]",
2145
member.Mapping.
ChoiceIdentifier
.Mapping.TypeDesc);
2429
WriteElement(anyElement.ArraySource, anyElement.ArrayName, anyElement.ChoiceArraySource, element, anyElement.Mapping.
ChoiceIdentifier
, anyElement.Mapping.CheckSpecified == SpecifiedAccessor.ReadWrite ? anyElement.CheckSpecifiedSource : null, false, false, -1, i);
2468
ChoiceIdentifierAccessor? choice = member.Mapping.
ChoiceIdentifier
;
2650
if (member.Mapping.
ChoiceIdentifier
!= null)
2659
ilg.Ldc(member.Mapping.
ChoiceIdentifier
.Mapping!.TypeDesc!.Type!);
2662
ilg.ConvertValue(XmlSerializationReader_ShrinkArray.ReturnType, member.Mapping.
ChoiceIdentifier
.Mapping.TypeDesc.Type!.MakeArrayType());
2663
WriteSourceEnd(member.ChoiceSource!, member.Mapping.
ChoiceIdentifier
.Mapping.TypeDesc.Type!.MakeArrayType());
System\Xml\Serialization\XmlSerializationWriter.cs (11)
1714
if (member.
ChoiceIdentifier
!= null)
1716
string memberName = member.
ChoiceIdentifier
.MemberName!;
2743
if (member.
ChoiceIdentifier
!= null)
2747
if (mapping.Members[j].Name == member.
ChoiceIdentifier
.MemberName)
2749
if (member.
ChoiceIdentifier
.Mapping!.TypeDesc!.UseReflection)
2759
if (enumSource == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, "Can not find " + member.
ChoiceIdentifier
.MemberName + " in the members mapping."));
2773
WriteMember(source, enumSource, member.ElementsSortedByDerivation!, member.Text, member.
ChoiceIdentifier
, member.TypeDesc!, writeAccessors || hasWrapperElement);
3251
if (m.
ChoiceIdentifier
!= null)
3253
CodeIdentifier.CheckValidIdentifier(m.
ChoiceIdentifier
.MemberName);
3254
choiceSource = RaCodeGen.GetStringForMember("o", m.
ChoiceIdentifier
.MemberName, mapping.TypeDesc);
3256
WriteMember(RaCodeGen.GetStringForMember("o", m.Name, mapping.TypeDesc), choiceSource, m.ElementsSortedByDerivation!, m.Text, m.
ChoiceIdentifier
, m.TypeDesc!, true);
System\Xml\Serialization\XmlSerializationWriterILGen.cs (8)
506
if (member.
ChoiceIdentifier
!= null)
510
if (mapping.Members[j].Name == member.
ChoiceIdentifier
.MemberName)
519
if (enumSource == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, "Can not find " + member.
ChoiceIdentifier
.MemberName + " in the members mapping."));
524
WriteMember(new SourceInfo(source, source, null, null, ilg), enumSource, member.ElementsSortedByDerivation!, member.Text, member.
ChoiceIdentifier
, member.TypeDesc!, writeAccessors || hasWrapperElement);
1121
if (m.
ChoiceIdentifier
!= null)
1123
CodeIdentifier.CheckValidIdentifier(m.
ChoiceIdentifier
.MemberName);
1124
choiceSource = ReflectionAwareILGen.GetStringForMember("o", m.
ChoiceIdentifier
.MemberName);
1127
WriteMember(ReflectionAwareILGen.GetSourceForMember("o", m, m.MemberInfo, ilg), choiceSource, m.ElementsSortedByDerivation!, m.Text, m.
ChoiceIdentifier
, m.TypeDesc!, true);