Пример #1
0
        internal static List <Point> GetConnectionLine(ControlConnectorInfo source, ControlConnectorInfo sink, bool showLastLine)
        {
            List <Point> linePoints = new List <Point>();

            //Rect rectSource = GetRectWithMargin(source, margin);
            //Rect rectSink = GetRectWithMargin(sink, margin);

            Point startPoint = source.Position; // GetOffsetPoint(source, rectSource);
            Point endPoint   = sink.Position;   //GetOffsetPoint(sink, rectSink);

            linePoints.Add(startPoint);

            if (startPoint.Y != endPoint.Y && startPoint.X != endPoint.X)
            {
                Point midPoint = new Point((startPoint.X + endPoint.X) / 2, (startPoint.Y + endPoint.Y) / 2);
                linePoints.Add(new Point(startPoint.X, midPoint.Y));
                linePoints.Add(new Point(endPoint.X, midPoint.Y));
            }

            linePoints.Add(endPoint);

            //linePoints = OptimizeLinePoints(linePoints, new Rect[] { rectSource, rectSink }, source.Orientation, sink.Orientation);

            //CheckPathEnd(source, sink, showLastLine, linePoints);
            return(linePoints);
        }
Пример #2
0
        internal ControlConnectorInfo GetControlInfo()
        {
            ControlConnectorInfo info = new ControlConnectorInfo();

            info.Orientation = this.Orientation;
            info.Position    = this.Position;
            return(info);
        }