/// <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);
        }
Exemple #2
0
        public void doWork()
        {
            NodeDelegate   collisions = quadCollisions;
            ObjectDelegate movement   = quadMovement;

            tree.traverse(collisions, false);
            tree.traverse(movement, true);
        }
Exemple #3
0
        /// <summary>
        /// 遍历节点
        /// </summary>
        /// <param name="handler">Handler.</param>
        public void Foreach(NodeDelegate handler)
        {
            if (handler == null || _Root == null)
            {
                return;
            }

            _Root.Handle(handler);
        }
Exemple #4
0
 /// <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));
         }
     }
 }
Exemple #5
0
        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);
            }
        }
Exemple #6
0
 public void Execute(string path, NodeDelegate nodeDelegate)
 {
     new NodeCommand
     {
         Module = "node",
         IsNPM = false,
         Arguments = String.Format("\"-e\" \"{0}\"", contents),
         Path = path,
         Delegate = nodeDelegate
     }.Start();
 }
Exemple #7
0
 public static void Default(string targetPath, NodeDelegate nodeDelegate)
 {
     UserInterface.OutputPane.Show();
     try
     {
         Run(targetPath, "default", nodeDelegate);
     }
     catch (Exception ex)
     {
         UserInterface.ShowError(ex.ToString());
     }
 }
Exemple #8
0
 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);
     });
 }
Exemple #9
0
        /** 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]);
                }
            }
        }
Exemple #10
0
 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();
 }
Exemple #11
0
 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);
             }
         }
     }
 }
Exemple #12
0
            /// <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);
                }
            }
Exemple #13
0
        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);
                }
            }
        }
Exemple #14
0
 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());
     }
 }
Exemple #15
0
		/** 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]);
				}
			}
		}
Exemple #16
0
		/** 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);
		}
Exemple #17
0
		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;
 }
Exemple #19
0
 /** 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);
 }