public static TreeNode MakeOtherType(this TreeNode parent, Func<object,bool> condition, TreeNodeType newType)
{
foreach (TreeNode node in parent.Nodes)
{
TreeNodeTag tag = node.Tag as TreeNodeTag;
if (tag != null)
{
if (condition(tag.Object))
tag.Type = newType;
}
}
return parent;
}