/// <summary> /// Returns if any of the node's parents is a given node. /// </summary> /// <param name="parent">The node we want to check if it is a ancestor of this node.</param> /// <returns>Returns true if this node is a descendant of the given node.</returns> public bool HasParent(BaseNode parent) { if (_parent == null) { return(false); } if (_parent == parent) { return(true); } return(_parent.HasParent(parent)); }