System.Xml.Schema.Compiler.IsGroupBaseFromGroupBase C# (CSharp) Méthode

IsGroupBaseFromGroupBase() private méthode

private IsGroupBaseFromGroupBase ( XmlSchemaGroupBase derivedGroupBase, XmlSchemaGroupBase baseGroupBase, bool skipEmptableOnly ) : bool
derivedGroupBase XmlSchemaGroupBase
baseGroupBase XmlSchemaGroupBase
skipEmptableOnly bool
Résultat bool
        private bool IsGroupBaseFromGroupBase(XmlSchemaGroupBase derivedGroupBase, XmlSchemaGroupBase baseGroupBase,  bool skipEmptableOnly) {
            if (!IsValidOccurrenceRangeRestriction(derivedGroupBase, baseGroupBase)) {
                restrictionErrorMsg = Res.GetString(Res.Sch_GroupBaseRestRangeInvalid);
                return false;
            }
            if (derivedGroupBase.Items.Count > baseGroupBase.Items.Count) {
                restrictionErrorMsg = Res.GetString(Res.Sch_GroupBaseRestNoMap);
                return false;
            }
            int count = 0;
            foreach(XmlSchemaParticle baseParticle in baseGroupBase.Items) {
                if ((count < derivedGroupBase.Items.Count) && IsValidRestriction((XmlSchemaParticle)derivedGroupBase.Items[count], baseParticle)) {
                    count ++;
                }
                else if (skipEmptableOnly && !IsParticleEmptiable(baseParticle)) {
                    if (restrictionErrorMsg == null) { //If restriction failed on previous check, do not overwrite error 
                        restrictionErrorMsg = Res.GetString(Res.Sch_GroupBaseRestNotEmptiable);
                    }
                    return false;
                }
            }
            if (count < derivedGroupBase.Items.Count) {
                return false;
            }
            return true;
        }
Compiler