Ejemplo n.º 1
0
        protected override void OnNodeAdded(Node node)
        {
            base.OnNodeAdded(node);
            MyNodeData data = node.Data as MyNodeData;

            if (data == null)
            {
                return;
            }
            // look at the node's Figure
            switch (data.Figure)
            {
            case NodeFigure.Input:
            case NodeFigure.Output:
            case NodeFigure.ManualOperation: {
                FrameworkElement leftport = node.FindPort("2", false);
                if (leftport != null)
                {
                    SpotPanel.SetSpot(leftport, new Spot(0.05, 0.5, 1, 0));
                }
                FrameworkElement rightport = node.FindPort("3", false);
                if (rightport != null)
                {
                    SpotPanel.SetSpot(rightport, new Spot(0.95, 0.5, -1, 0));
                }
                break;
            }

            default: break;
            }
        }