示例#1
0
 /// <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));
 }
示例#2
0
 /// <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));
 }
示例#3
0
 /// <summary>
 /// Returns the root node for this tree.
 /// </summary>
 /// <returns></returns>
 public virtual NodeProxy GetRootNode()
 {
     return(NodeProxy.GetRootNode(this));
 }
示例#4
0
 /// <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);
 }
示例#5
0
 /// <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));
 }
示例#6
0
 /// <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));
 }
示例#7
0
 /// <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));
 }
示例#8
0
 /// <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));
 }
示例#9
0
 /// <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));
 }
示例#10
0
 /// <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));
 }
示例#11
0
 /// <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));
 }
示例#12
0
 /// <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);
 }
示例#13
0
 /// <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));
 }
示例#14
0
 /// <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));
 }
示例#15
0
 /// <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));
 }
示例#16
0
 /// <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));
 }