Class
ConnectionUtilities

Utilities and extension methods related to connections.

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.WinControls.RadDiagram.dll

Syntax:

cs-api-definition
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

cs-api-definition
public static IList<Point> AllPoints(this IConnection connection)

Parameters

connection

IConnection

The connection.

Returns

IList<Point>

CalculateMiddlePointOfLine(Tuple<Point, Point>, IList<Point>)

Calculates the middle point of line.

Declaration

cs-api-definition
public static Point CalculateMiddlePointOfLine(Tuple<Point, Point> connectionEnds, IList<Point> connectionPoints)

Parameters

connectionEnds

Tuple<Point, Point>

The connection end points.

connectionPoints

IList<Point>

The points of interest (points where the line is curved/segmented).

Returns

Point

GetBezierDefaultHandlePoint(Point, Point, Point)

Gets the bezier default handle point.

Declaration

cs-api-definition
public static Point GetBezierDefaultHandlePoint(Point entryPoint, Point endPoint, Point connectorCenter)

Parameters

entryPoint

Point

The entry point.

endPoint

Point

The end point (opposite of the entryPoint ).

connectorCenter

Point

The center of the connectors.

Returns

Point

GetBezierDefaultHandlePoint(Point, Point, Point, double)

Gets the bezier default handle point.

Declaration

cs-api-definition
public static Point GetBezierDefaultHandlePoint(Point entryPoint, Point endPoint, Point connectorCenter, double bezierTension)

Parameters

entryPoint

Point

The entry point.

endPoint

Point

The end point.

connectorCenter

Point

The connector center.

bezierTension

double

The bezier tension.

Returns

Point

GetConnectionEndPoints(IConnection, bool)

Gets the connection end points.

Declaration

cs-api-definition
public static Tuple<Point, Point> GetConnectionEndPoints(this IConnection connection, bool useConnectionCoordinates = false)

Parameters

connection

IConnection

The connection.

useConnectionCoordinates

bool

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

Tuple<Point, Point>

GetDefaultHandleBezierPoints(IConnection, Point, Point, Point?, Point?)

Gets the default handle bezier points.

Declaration

cs-api-definition
public static Tuple<Point, Point> GetDefaultHandleBezierPoints(this IConnection connection, Point startPoint, Point endPoint, Point? sourceConnectorCenter = null, Point? targetConnectorCenter = null)

Parameters

connection

IConnection

The connection.

startPoint

Point

The cached start point.

endPoint

Point

The cached end point.

sourceConnectorCenter

Point?

The source connector center.

targetConnectorCenter

Point?

The target connector center.

Returns

Tuple<Point, Point>

SegmentCount(IConnection)

Returns the number of segments defined by the intermediate points.

Declaration

cs-api-definition
public static int SegmentCount(this IConnection conn)

Parameters

conn

IConnection

The connection.

Returns

int

SetConnectionPoints(IConnection, IEnumerable<Point>)

Sets the connection points.

Declaration

cs-api-definition
public static void SetConnectionPoints(this IConnection connection, IEnumerable<Point> connectionPoints)

Parameters

connection

IConnection

The connection.

connectionPoints

IEnumerable<Point>

The connection points.

TranslateConnectionPoints(IConnection, bool)

Shifts the ConnectionPoints by adding or substracting the Position vector.

Declaration

cs-api-definition
public static IEnumerable<Point> TranslateConnectionPoints(this IConnection connection, bool globalCoordinates = true)

Parameters

connection

IConnection

The connection. to shift.

globalCoordinates

bool

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.