WikiFunctions.Tools.IsSubnodeOf C# (CSharp) Method

IsSubnodeOf() public static method

returns true if testnode is the same or a subnode of refnode
public static IsSubnodeOf ( TreeNode refnode, TreeNode testnode ) : bool
refnode System.Windows.Forms.TreeNode
testnode System.Windows.Forms.TreeNode
return bool
        public static bool IsSubnodeOf(TreeNode refnode, TreeNode testnode)
        {
            for (TreeNode t = testnode; t != null; t = t.Parent)
            {
                if (ReferenceEquals(refnode, t))
                    return true;
            }
            return false;
        }
Tools