public static TreeViewItemEx Search(TreeViewItemEx root, TreeViewItemEx value, Object tag) { if (root == null) { return(null); } foreach (TreeViewItemEx item in root.ParentItems) { if (tag != null) { if (item.Tag == tag) { return(item); } } else { if (item == value) { return(item); } } if (item.HasItems) { TreeViewItemEx result = TreeViewItemEx.Search((TreeViewItemEx)item.Items[0], value, tag); if (result != null) { return(result); } } } return(null); }
public TreeViewItemEx Search(TreeViewItemEx item, Object tag) { TreeViewItemEx result = TreeViewItemEx.Search(Root, item, tag); return(result); }