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

ImportSubstitutionGroupMember() private method

private ImportSubstitutionGroupMember ( XmlSchemaElement element, string identifier, CodeIdentifiers members, CodeIdentifiers membersScope, string ns, bool repeats, bool &needExplicitOrder, bool allowDuplicates ) : bool
element System.Xml.Schema.XmlSchemaElement
identifier string
members CodeIdentifiers
membersScope CodeIdentifiers
ns string
repeats bool
needExplicitOrder bool
allowDuplicates bool
return bool
        private bool ImportSubstitutionGroupMember(XmlSchemaElement element, string identifier, CodeIdentifiers members, CodeIdentifiers membersScope, string ns, bool repeats, ref bool needExplicitOrder, bool allowDuplicates)
        {
            XmlSchemaElement[] elements = GetEquivalentElements(element);
            if (elements.Length == 0)
                return false;
            XmlSchemaChoice choice = new XmlSchemaChoice();
            for (int i = 0; i < elements.Length; i++)
                choice.Items.Add(elements[i]);
            if (!element.IsAbstract)
                choice.Items.Add(element);
            if (identifier.Length == 0)
                identifier = CodeIdentifier.MakeValid(Accessor.UnescapeName(element.Name));
            else
                identifier += CodeIdentifier.MakePascal(Accessor.UnescapeName(element.Name));
            ImportChoiceGroup(choice, identifier, members, membersScope, null, ns, repeats, ref needExplicitOrder, allowDuplicates);

            return true;
        }