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