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. |
return | bool |
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); }
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); }