Ejemplo n.º 1
0
 private void WorkspacesModified(WorkspacesModificationEventArgs args)
 {
     Assert.AreEqual(args.Name, "Add");
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Computes the upstream nodes when workspace is added. when a workspace is added (assuming that
        /// all the nodes and its connectors were added successfully) compute the upstream cache for all
        /// the frozen nodes.
        /// </summary>
        /// <param name="args">The <see cref="WorkspacesModificationEventArgs"/> instance containing the event data.</param>
        private void computeUpstreamNodesWhenWorkspaceAdded(WorkspacesModificationEventArgs args)
        {
            if (args.Id == this.Guid)
            {
                this.workspaceLoaded = true;
                this.ComputeUpstreamCacheForEntireGraph();

                // If the entire graph is frozen then set silenceModification
                // to false on the workspace. This is required
                // becuase if all the nodes are frozen, then updategraphsyncdata task
                // has nothing to process and the graph will not run. setting silenceModification here
                // ensure graph runs immediately when any of the node is set to unfreeze.
                lock (nodes)
                {
                    if (nodes != null && nodes.Any() && nodes.All(z => z.IsFrozen))
                    {
                        var firstnode = nodes.First();
                        firstnode.OnRequestSilenceModifiedEvents(false);
                    }
                }
            }
        }