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);
}
}
}
}