Example #1
0
        Point ComputeStartPoint(IConnectable firstPoint, IConnectable nextPoint, ref double startPointRelativePos, ref ConnectorDocking docking, ref ulong connectorStartPort)
        {
            var start = _startPointHint;

            if (docking == ConnectorDocking.Undefined)
            {
                start = firstPoint.GetPreferredConnectorStart(start, out startPointRelativePos, out docking, out connectorStartPort);
                if (connectorStartPort == 0)
                {
                    start = ConnectorUtilities.ComputeCenter(nextPoint.Bounds);
                    start = firstPoint.GetPreferredConnectorStart(start, out startPointRelativePos, out docking, out connectorStartPort);
                }
            }
            else
            {
                start = firstPoint.GetConnectorPoint(docking, startPointRelativePos, connectorStartPort);
            }
            return(start);
        }
Example #2
0
        Point ComputeEndPoint(IConnectable firstPoint, IConnectable nextPoint, ref double relativePos, ref ConnectorDocking docking, ref ulong connectorEndPort)
        {
            var end = _endPointHint;

            if (docking == ConnectorDocking.Undefined)
            {
                end = nextPoint.GetPreferredConnectorEnd(end, out relativePos, out docking, out connectorEndPort);
                if (connectorEndPort == 0)
                {
                    nextPoint.GetPreferredConnectorEnd(ConnectorUtilities.ComputeCenter(firstPoint.Bounds),
                                                       out relativePos, out docking, out connectorEndPort);
                }
            }
            else
            {
                end = nextPoint.GetConnectorPoint(docking, relativePos, connectorEndPort);
            }
            return(end);
        }