System.Xml.Serialization.XmlSchemaImporter.ImportGroupMembers C# (CSharp) Method

ImportGroupMembers() private method

private ImportGroupMembers ( XmlSchemaParticle particle, string identifier, CodeIdentifiers members, CodeIdentifiers membersScope, INameScope elementsScope, string ns, bool groupRepeats, bool &mixed, bool &needExplicitOrder, bool allowDuplicates, bool allowUnboundedElements ) : void
particle System.Xml.Schema.XmlSchemaParticle
identifier string
members CodeIdentifiers
membersScope CodeIdentifiers
elementsScope INameScope
ns string
groupRepeats bool
mixed bool
needExplicitOrder bool
allowDuplicates bool
allowUnboundedElements bool
return void
        private void ImportGroupMembers(XmlSchemaParticle particle, string identifier, CodeIdentifiers members, CodeIdentifiers membersScope, INameScope elementsScope, string ns, bool groupRepeats, ref bool mixed, ref bool needExplicitOrder, bool allowDuplicates, bool allowUnboundedElements)
        {
            if (particle is XmlSchemaGroupRef)
            {
                XmlSchemaGroupRef refGroup = (XmlSchemaGroupRef)particle;
                if (!refGroup.RefName.IsEmpty)
                {
                    AddReference(refGroup.RefName, GroupsInUse, SR.XmlCircularGroupReference);
                    ImportGroupMembers(FindGroup(refGroup.RefName).Particle, identifier, members, membersScope, elementsScope, refGroup.RefName.Namespace, groupRepeats | refGroup.IsMultipleOccurrence, ref mixed, ref needExplicitOrder, allowDuplicates, allowUnboundedElements);
                    RemoveReference(refGroup.RefName, GroupsInUse);
                }
            }
            else if (particle is XmlSchemaGroupBase)
            {
                XmlSchemaGroupBase group = (XmlSchemaGroupBase)particle;

                if (group.IsMultipleOccurrence)
                    groupRepeats = true;

                if (GenerateOrder && groupRepeats && group.Items.Count > 1)
                {
                    ImportChoiceGroup(group, identifier, members, membersScope, elementsScope, ns, groupRepeats, ref needExplicitOrder, allowDuplicates);
                }
                else
                {
                    for (int i = 0; i < group.Items.Count; i++)
                    {
                        object item = group.Items[i];
                        if (item is XmlSchemaChoice)
                            ImportChoiceGroup((XmlSchemaGroupBase)item, identifier, members, membersScope, elementsScope, ns, groupRepeats, ref needExplicitOrder, allowDuplicates);
                        else if (item is XmlSchemaElement)
                            ImportElementMember((XmlSchemaElement)item, identifier, members, membersScope, elementsScope, ns, groupRepeats, ref needExplicitOrder, allowDuplicates, allowUnboundedElements);
                        else if (item is XmlSchemaAny)
                        {
                            ImportAnyMember((XmlSchemaAny)item, identifier, members, membersScope, elementsScope, ns, ref mixed, ref needExplicitOrder, allowDuplicates);
                        }
                        else if (item is XmlSchemaParticle)
                        {
                            ImportGroupMembers((XmlSchemaParticle)item, identifier, members, membersScope, elementsScope, ns, groupRepeats, ref mixed, ref needExplicitOrder, allowDuplicates, true);
                        }
                    }
                }
            }
        }