ContainsEveryChildOf() static private méthode

Checks whether 'toCheck' has all children that 'desired' has and values of 'val' attributes are the same
static private ContainsEveryChildOf ( System.Xml.Linq.XElement desired, System.Xml.Linq.XElement toCheck, MatchFormattingOptions fo ) : bool
desired System.Xml.Linq.XElement
toCheck System.Xml.Linq.XElement
fo MatchFormattingOptions Matching options whether check if desired attributes are inder a, or a has exactly and only these attributes as b has.
Résultat bool
Exemple #1
0
        internal int RemoveTextWithFormatRecursive(XElement element, Formatting matchFormatting, MatchFormattingOptions fo)
        {
            int num = 0;

            foreach (XElement item in element.Elements())
            {
                if ("rPr".Equals(item.Name.LocalName) && HelperFunctions.ContainsEveryChildOf(matchFormatting.Xml, item, fo))
                {
                    item.Parent.Remove();
                    num++;
                }
                num += RemoveTextWithFormatRecursive(item, matchFormatting, fo);
            }
            return(num);
        }
Exemple #2
0
        internal int RemoveTextWithFormatRecursive(XElement element, Formatting matchFormatting, MatchFormattingOptions fo)
        {
            var deletedCount = 0;

            foreach (var x in element.Elements())
            {
                if ("rPr".Equals(x.Name.LocalName))
                {
                    if (HelperFunctions.ContainsEveryChildOf(matchFormatting.Xml, x, fo))
                    {
                        x.Parent.Remove();
                        ++deletedCount;
                    }
                }

                deletedCount += RemoveTextWithFormatRecursive(x, matchFormatting, fo);
            }

            return(deletedCount);
        }