ContainsEveryChildOf() 정적인 개인적인 메소드

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.
리턴 bool
예제 #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);
        }
예제 #2
0
파일: Container.cs 프로젝트: ruo2012/DocX
        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);
        }