AnimatGuiCtrls.Controls.ComboTreeBox.OwnsNode C# (CSharp) Method

OwnsNode() private method

Determines whether the specified node belongs to this ComboTreeBox, and hence is a valid selection. For the purposes of this method, a null value is always a valid selection.
private OwnsNode ( ComboTreeNode node ) : bool
node ComboTreeNode
return bool
        private bool OwnsNode(ComboTreeNode node)
        {
            if (node == null) return true;

            ComboTreeNode parent = node;
            while (parent.Parent != null) parent = parent.Parent;
            return nodes.Contains(parent);
        }