Esempio n. 1
0
        public OutputDock addOutput(int type)
        {
            OutputDock dock = new OutputDock(this, type);

            stackOutputs.Children.Add(dock);
            return(dock);
        }
Esempio n. 2
0
        public Pipe(OutputDock output, InputDock input)
        {
            bezier = new BezierSegment()
            {
                IsStroked = true
            };

            // Set up the Path to insert the segments
            PathGeometry pathGeometry = new PathGeometry();

            pathFigure          = new PathFigure();
            pathFigure.IsClosed = false;
            pathGeometry.Figures.Add(pathFigure);

            this.inputDock  = input;
            this.outputDock = output;
            if (input == null || output == null)
            {
                EditingPipe = this;
            }

            pathFigure.Segments.Add(bezier);
            path = new Path();
            path.IsHitTestVisible = false;
            path.Stroke           = graph.context.getPipeColor((input != null)? input.type : output.type);
            path.StrokeThickness  = 2;
            path.Data             = pathGeometry;

            graph.canvas.Children.Add(path);
            ((UIElement)graph.canvas.Parent).MouseMove += Canvas_MouseMove;
        }