/// <param name="ids"> /// The IDs of the Nodes to return. /// </param> public QueryRootQuery nodes(NodeDelegate buildQuery, List <string> ids, string alias = null) { if (alias != null) { ValidationUtils.ValidateAlias(alias); Query.Append("nodes___"); Query.Append(alias); Query.Append(":"); } Query.Append("nodes "); Arguments args = new Arguments(); args.Add("ids", ids); Query.Append(args.ToString()); Query.Append("{"); buildQuery(new NodeQuery(Query)); Query.Append("}"); return(this); }
public void doWork() { NodeDelegate collisions = quadCollisions; ObjectDelegate movement = quadMovement; tree.traverse(collisions, false); tree.traverse(movement, true); }
/// <summary> /// 遍历节点 /// </summary> /// <param name="handler">Handler.</param> public void Foreach(NodeDelegate handler) { if (handler == null || _Root == null) { return; } _Root.Handle(handler); }
/// <summary> /// /// </summary> /// <param name="nodeDelegate"></param> public void ForEachNode(NodeDelegate <T> nodeDelegate) { if (nodeDelegate != null) { foreach (T u in this) { nodeDelegate(this, new NodeEventArgs <T>(this, u)); } } }
public void traverse(NodeDelegate del, bool movementChange) { List <QuadNode> queue = new List <QuadNode>(); queue.Add(rootNode); for (int a = 0; a < queue.Count; a++) { QuadNode node = queue.ElementAt(a); node.traverse(del, queue, movementChange); } }
public void Execute(string path, NodeDelegate nodeDelegate) { new NodeCommand { Module = "node", IsNPM = false, Arguments = String.Format("\"-e\" \"{0}\"", contents), Path = path, Delegate = nodeDelegate }.Start(); }
public static void Default(string targetPath, NodeDelegate nodeDelegate) { UserInterface.OutputPane.Show(); try { Run(targetPath, "default", nodeDelegate); } catch (Exception ex) { UserInterface.ShowError(ex.ToString()); } }
public static void LoadTasks(string path, NodeDelegate nodeDelegate) { var snip = new NodeSnippet(Resources.NodeSnippets.GetGruntTasks); snip.Execute(path, delegate(NodeResponse nodeResponse) { if (nodeResponse.Process.HasExited) { ParseTasks(nodeResponse.FullText); } nodeDelegate.Invoke(nodeResponse); }); }
/** Get all connections for a node. * This function will call the callback with every node this node is connected to. * This is a base function and will simply loop through the #connections array. * \see GetConnections */ public void GetConnectionsBase(NodeDelegate callback) { if (connections == null) { return; } for (int i = 0; i < connections.Length; i++) { if (connections[i].walkable) { callback(connections[i]); } } }
public static void Run(string targetPath, string taskName, NodeDelegate nodeDelegate) { var cmd = new NodeCommand { Module = CommandModuleString, Arguments = String.Format("--no-color {0}", taskName), Path = targetPath, Delegate = delegate(NodeResponse response) { UserInterface.Log(response.Message); nodeDelegate.Invoke(response); } }; cmd.Start(); }
public void traverse(NodeDelegate del, List <QuadNode> queue, bool movementChange) { del(this); for (int x = 0; x < 2; x++) { for (int y = 0; y < 2; y++) { if (children[x, y] != null) { queue.Add(children[x, y]); children[x, y].traverse(del, queue, movementChange); } } } }
/// <summary> /// 处理 /// </summary> /// <param name="handler">Handler.</param> public void Handle(NodeDelegate handler) { if (handler == null) { return; } handler(this); if (this.Left != null) { this.Left.Handle(handler); } if (this.Right != null) { this.Right.Handle(handler); } }
public override void GetConnections(NodeDelegate callback) { GetConnectionsBase(callback); GridGraph graph = gridGraphs[indices >> 24]; int index = GetIndex(); int[] neighbourOffsets = graph.neighbourOffsets; Node[] nodes = graph.nodes; for (int i = 0; i < 8; i++) { if (((flags >> i) & 1) == 1) { Node node = nodes[index + neighbourOffsets[i]]; callback(node); } } }
public static void Install(string projectPath, NodeDelegate nodeDelegate) { try { UserInterface.OutputPane.Show(); var cmd = new NodeCommand { Module = "npm", Arguments = "install", Path = projectPath, Delegate = delegate(NodeResponse response) { UserInterface.Log(response.Message); nodeDelegate.Invoke(response); } }; cmd.Start(); } catch (Exception ex) { UserInterface.ShowError(ex.ToString()); } }
/** Get all connections for a node. * This function will call the callback with every node this node is connected to. * This is a base function and will simply loop through the #connections array. * \see GetConnections */ public void GetConnectionsBase (NodeDelegate callback) { if (connections == null) { return; } for (int i=0;i<connections.Length;i++) { if (connections[i].walkable) { callback (connections[i]); } } }
/** Get all connections for a node. * This function will call the callback with every node this node is connected to. * In contrast to the #connections array this function also includes custom connections which * for example grid graphs use. * \since Added in version 3.2 */ public virtual void GetConnections (NodeDelegate callback) { GetConnectionsBase (callback); }
public override void GetConnections (NodeDelegate callback) { GetConnectionsBase (callback); GridGraph graph = gridGraphs[indices >> 24]; int index = GetIndex (); int[] neighbourOffsets = graph.neighbourOffsets; Node[] nodes = graph.nodes; for (int i=0;i<8;i++) { if (((flags >> i) & 1) == 1) { Node node = nodes[index+neighbourOffsets[i]]; callback (node); } } }
public iFolderAdvanced() { nodeDelegate = new NodeDelegate(nodeEvent); fileSyncDelegate = new FileSyncDelegate(fileSync); collectionSyncDelegate = new CollectionSyncDelegate(collectionSync); eventQueue = new Queue(); workEvent = new AutoResetEvent(false); if (worker == null) { worker = new Thread(new ThreadStart(eventThreadProc)); worker.Name = "iFolder Advanced Event Process"; worker.IsBackground = true; worker.Priority = ThreadPriority.BelowNormal; worker.Start(); } InitializeComponent(); apply.Enabled = remove.Enabled = access.Enabled = false; syncInterval.TextChanged += new EventHandler(syncInterval_ValueChanged); initTabTop = tabControl1.Top; initMinSize = this.Size; currentControl = firstControl = this.ifolders; lastControl = this.apply; resizeButton(syncNow); int delta = calculateSize(ifolderLabel, 0); ifolderLabel.Width += delta; int temp = ifolders.Left; ifolders.Left = ifolderLabel.Left + ifolderLabel.Width; ifolders.Width -= ifolders.Left - temp; leftDelta = tabControl1.Width - shareWith.Right; bottomDelta = tabControl1.Height - shareWith.Bottom; lvbDelta = access.Top - (shareWith.Top + shareWith.Height); bbDelta = remove.Left - (add.Left + add.Width); this.StartPosition = FormStartPosition.CenterParent; }
/** Get all connections for a node. * This function will call the callback with every node this node is connected to. * In contrast to the #connections array this function also includes custom connections which * for example grid graphs use. * \since Added in version 3.2 */ public virtual void GetConnections(NodeDelegate callback) { GetConnectionsBase(callback); }