ClassConnectionUtilities
Utilities and extension methods related to connections.
Definition
Namespace:Telerik.Windows.Diagrams.Core
Assembly:Telerik.WinControls.RadDiagram.dll
Syntax:
public static class ConnectionUtilities
Inheritance: objectConnectionUtilities
Methods
AllPoints(IConnection)
Returns all the points of this connection, i.e. the start and end points together with the intermediate connection points.
Declaration
public static IList<Point> AllPoints(this IConnection connection)
Parameters
connection
The connection.
Returns
IList<Point>
CalculateMiddlePointOfLine(Tuple<Point, Point>, IList<Point>)
Calculates the middle point of line.
Declaration
public static Point CalculateMiddlePointOfLine(Tuple<Point, Point> connectionEnds, IList<Point> connectionPoints)
Parameters
connectionEnds
The connection end points.
connectionPoints
IList<Point>
The points of interest (points where the line is curved/segmented).
Returns
GetBezierDefaultHandlePoint(Point, Point, Point)
Gets the bezier default handle point.
Declaration
public static Point GetBezierDefaultHandlePoint(Point entryPoint, Point endPoint, Point connectorCenter)
Parameters
entryPoint
The entry point.
endPoint
The end point (opposite of the entryPoint ).
connectorCenter
The center of the connectors.
Returns
GetBezierDefaultHandlePoint(Point, Point, Point, double)
Gets the bezier default handle point.
Declaration
public static Point GetBezierDefaultHandlePoint(Point entryPoint, Point endPoint, Point connectorCenter, double bezierTension)
Parameters
entryPoint
The entry point.
endPoint
The end point.
connectorCenter
The connector center.
bezierTension
The bezier tension.
Returns
GetConnectionEndPoints(IConnection, bool)
Gets the connection end points.
Declaration
public static Tuple<Point, Point> GetConnectionEndPoints(this IConnection connection, bool useConnectionCoordinates = false)
Parameters
connection
The connection.
useConnectionCoordinates
If set to true the points will be in global coordinates. If set to false, then the coordinates will be relative to the connection.
Returns
GetDefaultHandleBezierPoints(IConnection, Point, Point, Point?, Point?)
Gets the default handle bezier points.
Declaration
public static Tuple<Point, Point> GetDefaultHandleBezierPoints(this IConnection connection, Point startPoint, Point endPoint, Point? sourceConnectorCenter = null, Point? targetConnectorCenter = null)
Parameters
connection
The connection.
startPoint
The cached start point.
endPoint
The cached end point.
sourceConnectorCenter
The source connector center.
targetConnectorCenter
The target connector center.
Returns
SegmentCount(IConnection)
Returns the number of segments defined by the intermediate points.
Declaration
public static int SegmentCount(this IConnection conn)
Parameters
conn
The connection.
Returns
SetConnectionPoints(IConnection, IEnumerable<Point>)
Sets the connection points.
Declaration
public static void SetConnectionPoints(this IConnection connection, IEnumerable<Point> connectionPoints)
Parameters
connection
The connection.
connectionPoints
IEnumerable<Point>
The connection points.
TranslateConnectionPoints(IConnection, bool)
Shifts the ConnectionPoints by adding or substracting the Position vector.
Declaration
public static IEnumerable<Point> TranslateConnectionPoints(this IConnection connection, bool globalCoordinates = true)
Parameters
connection
The connection. to shift.
globalCoordinates
If set to true points will be transformed to global coordinates. If set to false, then the coordinates will be relative to the connection.
Returns
IEnumerable<Point>
Remarks
The start/end points are not taken into account here.