Exemplo n.º 1
0
        private GraphNode GetGraphNode(IFlowNode node)
        {
            GraphNode graphNode;

            nodeList.TryGetValue(node.GetID(), out graphNode);
            return(graphNode);
        }
Exemplo n.º 2
0
        public IEnumerable <IFlowNode> GetNextSteps(IFlowNode node)
        {
            GraphNode graphNode = GetGraphNode(node);

            if (graphNode != null)
            {
                return(graphNode.nextNodes.Select((n) => n.node));
            }
            else
            {
                throw new System.InvalidOperationException("The node " + node.GetID() + " could not be found in the dpendency graph");
            }
        }
Exemplo n.º 3
0
        public bool IsNodeValidToInstall(IFlowNode node)
        {
            bool      validToInstall = true;
            GraphNode graphNode      = GetGraphNode(node);

            if (graphNode != null)
            {
                foreach (var pnode in graphNode.previousNodes)
                {
                    if (((Node)pnode.node).GetInstallationState() == InstallationState.NotInstalled)
                    {
                        validToInstall = false;
                        break;
                    }
                }
            }
            else
            {
                throw new System.InvalidOperationException("The node " + node.GetID() + " could not be found in the dpendency graph");
            }
            return(validToInstall);
        }