System.Xml.Schema.SchemaCollectionCompiler.CannonicalizeElement C# (CSharp) Method

CannonicalizeElement() private method

private CannonicalizeElement ( XmlSchemaElement element, bool substitution ) : XmlSchemaParticle
element XmlSchemaElement
substitution bool
return XmlSchemaParticle
        private XmlSchemaParticle CannonicalizeElement(XmlSchemaElement element, bool substitution) {
            if (!element.RefName.IsEmpty && substitution && (element.BlockResolved & XmlSchemaDerivationMethod.Substitution) == 0) {
                XmlSchemaSubstitutionGroupV1Compat substitutionGroup = (XmlSchemaSubstitutionGroupV1Compat)examplars[element.QualifiedName];
                if (substitutionGroup == null) {
                    return element;
                }
                else {
                    XmlSchemaChoice choice = (XmlSchemaChoice)substitutionGroup.Choice.Clone(); 
                    choice.MinOccurs = element.MinOccurs;
                    choice.MaxOccurs = element.MaxOccurs;
                    return choice;
                }
            }
            else {
                return element;
            }
        }