Example #1
0
        public MoveNodeAction(NodeInfo nodeInfo, Point oldPosition, Point newPosition)
        {
            NodeInfo = nodeInfo;

            OldPosition = oldPosition;
            NewPosition = newPosition;
        }
Example #2
0
        private SlotInfo(NodeInfo nodeInfo, Slot slot)
        {
            Slot = slot;
            SlotAnchorBinder.PropertyChanged += SlotAnchorBinder_PropertyChanged;

            NodeInfo = nodeInfo;
        }
Example #3
0
        public MoveNodeAction(NodeInfo nodeInfo, Point position)
        {
            NodeInfo = nodeInfo;

            OldPosition = new Point(NodeInfo.X, NodeInfo.Y);
            NewPosition = position;
        }
Example #4
0
        public static SlotInfo From(NodeInfo nodeInfo, Slot slot)
        {
            SlotInfo slotInfo;

            if (!slotInfos.TryGetValue(slot, out slotInfo))
                slotInfos.Add(slot, slotInfo = new SlotInfo(nodeInfo, slot));

            return slotInfo;
        }
Example #5
0
        public static LinkInfo From(NodeInfo nodeInfo, Slot slot, Node node)
        {
            Tuple<Slot, Node> tuple = new Tuple<Slot, Node>(slot, node);
            LinkInfo linkInfo;

            if (!linkInfos.TryGetValue(tuple, out linkInfo))
                linkInfos.Add(tuple, linkInfo = new LinkInfo(nodeInfo, slot, node));

            return linkInfo;
        }
Example #6
0
        private LinkInfo(NodeInfo nodeInfo, Slot slot, Node node)
        {
            Slot = slot;
            SlotInfo = SlotInfo.From(nodeInfo, slot);
            SlotInfo.PropertyChanged += SlotInfo_PropertyChanged;

            Node = node;
            NodeInfo = NodeInfo.From(nodeInfo.FlowInfo, node);
            NodeInfo.PropertyChanged += NodeInfo_PropertyChanged;
        }
Example #7
0
 public AddLinkAction(SlotInfo slotInfo, NodeInfo nodeInfo)
 {
     SlotInfo = slotInfo;
     NodeInfo = nodeInfo;
 }
Example #8
0
        private async Task Evaluate(NodeInfo nodeInfo)
        {
            NodeStep nodeStep;
            nodeInfo.Status = NodeStatus.Running;
           
            try
            {
                Log.Trace(DebuggerCategory, "Entering node {0}", nodeInfo.Type.Name);

                nodeStep = nodeInfo.Node.Evaluate();

                Log.Trace(DebuggerCategory, "Exiting node {0} with result {1}", nodeInfo.Type.Name, nodeStep.Result);
            }
            catch (Exception e)
            {
                Log.Error(DebuggerCategory, "Error while executing node {0}. {1}", nodeInfo.Type.Name, e.Message);
                nodeStep = new NodeStep(NodeResult.Fail, null);
            }

            if (State == DebuggerState.Idle)
                return;

            nodeInfo.Status = NodeStatus.Idle;
            nodeInfo.Result = nodeStep.Result;

            switch (nodeStep.Result)
            {
                case NodeResult.Skip: return;
                case NodeResult.Fail: Break(); return;
                case NodeResult.Stop: Stop(); return;
            }

            NodeInfo[] nodeInfos = nodeStep.Slot.Nodes.Select(n => NodeInfo.From(FlowInfo, n)).ToArray();

            foreach (NodeInfo node in nodeInfos)
                node.Status = NodeStatus.Paused;

            lock (nodes)
                nodes.AddRange(nodeInfos);
        }
Example #9
0
 public DeleteNodeAction(NodeInfo nodeInfo)
 {
     FlowInfo = nodeInfo.FlowInfo;
     Node = nodeInfo.Node;
 }
Example #10
0
 private VariableInfo(NodeInfo nodeInfo, Variable variable)
 {
     Variable = variable;
     NodeInfo = nodeInfo;
 }
Example #11
0
        public static VariableInfo From(NodeInfo nodeInfo, Variable variable)
        {
            VariableInfo variableInfo;

            if (!variableInfos.TryGetValue(variable, out variableInfo))
                variableInfos.Add(variable, variableInfo = new VariableInfo(nodeInfo, variable));

            return variableInfo;
        }
Example #12
0
        public static NodeInfo From(FlowInfo flowInfo, Node node)
        {
            NodeInfo nodeInfo;

            if (!nodeInfos.TryGetValue(node, out nodeInfo))
                nodeInfos.Add(node, nodeInfo = new NodeInfo(flowInfo, node));

            return nodeInfo;
        }