/// <summary> /// Returns the record node by id /// </summary> /// <param name="id"></param> /// <returns></returns> public virtual NodeProxy GetNodeById(object id) { return(NodeProxy.GetNodeById(this, id)); }
/// <summary> /// Replaces one child node in this node with another. /// </summary> /// <param name="newChild">The replacement node</param> /// <param name="oldChild">The node to replace</param> public virtual void ReplaceChild(Node newChild, NodeProxy oldChild) { this.Call("replaceChild", new JRawValue(newChild.ToScript()), new JRawValue(oldChild.NodeInstance)); }
/// <summary> /// Returns the root node for this tree. /// </summary> /// <returns></returns> public virtual NodeProxy GetRootNode() { return(NodeProxy.GetRootNode(this)); }
/// <summary> /// Removes a child node from this node. /// </summary> /// <param name="node">The node to remove</param> /// <param name="destroy">true to destroy the node upon removal. Defaults to false.</param> public virtual void RemoveChild(NodeProxy node, bool destroy) { this.Call("removeChild", new JRawValue(node.NodeInstance), destroy); }
/// <summary> /// Removes a child node from this node. /// </summary> /// <param name="node">The node to remove</param> public virtual void RemoveChild(NodeProxy node) { this.Call("removeChild", new JRawValue(node.NodeInstance)); }
/// <summary> /// Inserts the first node before the second node in this nodes childNodes collection. /// </summary> /// <param name="node">The node to insert</param> /// <param name="refNode">The node to insert before</param> public virtual void InsertBefore(Node node, NodeProxy refNode) { this.Call("insertBefore", new JRawValue(node.ToScript()), new JRawValue(refNode.NodeInstance)); }
/// <summary> /// Insert a node into this node /// </summary> /// <param name="index">The zero-based index to insert the node at</param> /// <param name="refNode">The node to insert</param> public virtual void InsertChild(int index, NodeProxy refNode) { this.Call("insertChild", index, new JRawValue(refNode.NodeInstance)); }
/// <summary> /// Returns true if the passed node is an ancestor (at any point) of this node. /// </summary> /// <param name="node"></param> /// <param name="trueFn"></param> /// <param name="falseFn"></param> public virtual void IsAncestor(NodeProxy node, JFunction trueFn, JFunction falseFn) { this.AddScript("if({0}.isAncestor({1})){{{2}}}else{{{3};}}", this.NodeInstance, node.NodeInstance, trueFn.ToCallScript(this.NodeInstance), falseFn.ToCallScript(this.NodeInstance)); }
/// <summary> /// Insert node(s) as the last child node of the node. /// /// If the node was previously a child node of another parent node, it will be removed from that node first. /// </summary> /// <param name="node">The node or Array of nodes to append</param> public virtual void AppendChild(NodeProxy node) { this.Call("appendChild", new JRawValue(node.NodeInstance)); }