Esempio n. 1
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;
        }
Esempio n. 2
0
        public Dock addInput(int type)
        {
            InputDock dock = new InputDock(this, type);

            stackInputs.Children.Add(dock);
            //stackInputs.UpdateLayout();
            //RenderSize = MeasureOverride(RenderSize);
            //RenderSize = ArrangeOverride(new Size(double.MaxValue, double.MaxValue));
            //Measure(new Size(double.MaxValue, double.MaxValue));
            return(dock);
        }