public void RemoveUnwantedTags(TreeRoot root) { TagCleaner cleaner = new TagCleaner(); TreeNode current = root.Child; RemoveUnwantedTagChild(current, cleaner, root); }
void RemoveUnwantedTagChild(TreeNode node, TagCleaner cleaner, TreeRoot root) { if (cleaner.TagRemover(node) != 1) { try { foreach (TreeNode current in node.Children) { RemoveUnwantedTagChild(current, cleaner, root); } } catch { RemoveUnwantedTags(root); } } }