New to Telerik UI for WinFormsStart a free 30-day trial

Utilities and extension methods related to connections.

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.WinControls.RadDiagram.dll

Syntax:

C#
public static class ConnectionUtilities

Inheritance: objectConnectionUtilities

Methods

Returns all the points of this connection, i.e. the start and end points together with the intermediate connection points.

C#
public static IList<Point> AllPoints(this IConnection connection)
Parameters:connectionIConnection

The connection.

Returns:

IList<Point>

Calculates the middle point of line.

C#
public static Point CalculateMiddlePointOfLine(Tuple<Point, Point> connectionEnds, IList<Point> connectionPoints)
Parameters:connectionEndsTuple<Point, Point>

The connection end points.

connectionPointsIList<Point>

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

Returns:

Point

Gets the bezier default handle point.

C#
public static Point GetBezierDefaultHandlePoint(Point entryPoint, Point endPoint, Point connectorCenter, double bezierTension)
Parameters:entryPointPoint

The entry point.

endPointPoint

The end point.

connectorCenterPoint

The connector center.

bezierTensiondouble

The bezier tension.

Returns:

Point

Gets the bezier default handle point.

C#
public static Point GetBezierDefaultHandlePoint(Point entryPoint, Point endPoint, Point connectorCenter)
Parameters:entryPointPoint

The entry point.

endPointPoint

The end point (opposite of the entryPoint ).

connectorCenterPoint

The center of the connectors.

Returns:

Point

Gets the connection end points.

C#
public static Tuple<Point, Point> GetConnectionEndPoints(this IConnection connection, bool useConnectionCoordinates = false)
Parameters:connectionIConnection

The connection.

useConnectionCoordinatesbool

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>

Gets the default handle bezier points.

C#
public static Tuple<Point, Point> GetDefaultHandleBezierPoints(this IConnection connection, Point startPoint, Point endPoint, Point? sourceConnectorCenter = null, Point? targetConnectorCenter = null)
Parameters:connectionIConnection

The connection.

startPointPoint

The cached start point.

endPointPoint

The cached end point.

sourceConnectorCenterPoint?

The source connector center.

targetConnectorCenterPoint?

The target connector center.

Returns:

Tuple<Point, Point>

Returns the number of segments defined by the intermediate points.

C#
public static int SegmentCount(this IConnection conn)
Parameters:connIConnection

The connection.

Returns:

int

Sets the connection points.

C#
public static void SetConnectionPoints(this IConnection connection, IEnumerable<Point> connectionPoints)
Parameters:connectionIConnection

The connection.

connectionPointsIEnumerable<Point>

The connection points.

Shifts the ConnectionPoints by adding or substracting the Position vector.

C#
public static IEnumerable<Point> TranslateConnectionPoints(this IConnection connection, bool globalCoordinates = true)
Parameters:connectionIConnection

The connection. to shift.

globalCoordinatesbool

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.