Class ConnectionUtilities
Utilities and extension methods related to connections.
Inheritance
Inherited Members
Namespace: Telerik.Windows.Diagrams.Core
Assembly: Telerik.WinControls.RadDiagram.dll
Syntax
public static class ConnectionUtilities
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
IConnection
connection
The connection. |
Returns
System.Collections.Generic.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
System.Tuple<Point, Point>
connectionEnds
The connection end points. |
System.Collections.Generic.IList<Point>
connectionPoints
The points of interest (points where the line is curved/segmented). |
Returns
Point
|
GetBezierDefaultHandlePoint(Point, Point, Point)
Gets the bezier default handle point.
Declaration
public static Point GetBezierDefaultHandlePoint(Point entryPoint, Point endPoint, Point connectorCenter)
Parameters
Point
entryPoint
The entry point. |
Point
endPoint
The end point (opposite of the |
Point
connectorCenter
The center of the connectors. |
Returns
Point
|
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
Point
entryPoint
The entry point. |
Point
endPoint
The end point. |
Point
connectorCenter
The connector center. |
System.Double
bezierTension
The bezier tension. |
Returns
Point
|
GetConnectionEndPoints(IConnection, Boolean)
Gets the connection end points.
Declaration
public static Tuple<Point, Point> GetConnectionEndPoints(this IConnection connection, bool useConnectionCoordinates = false)
Parameters
IConnection
connection
The connection. |
System.Boolean
useConnectionCoordinates
If set to |
Returns
System.Tuple<Point, Point>
|
GetDefaultHandleBezierPoints(IConnection, Point, Point, Nullable<Point>, Nullable<Point>)
Gets the default handle bezier points.
Declaration
public static Tuple<Point, Point> GetDefaultHandleBezierPoints(this IConnection connection, Point startPoint, Point endPoint, Point? sourceConnectorCenter = default(Point? ), Point? targetConnectorCenter = default(Point? ))
Parameters
IConnection
connection
The connection. |
Point
startPoint
The cached start point. |
Point
endPoint
The cached end point. |
System.Nullable<Point>
sourceConnectorCenter
The source connector center. |
System.Nullable<Point>
targetConnectorCenter
The target connector center. |
Returns
System.Tuple<Point, Point>
|
SegmentCount(IConnection)
Returns the number of segments defined by the intermediate points.
Declaration
public static int SegmentCount(this IConnection conn)
Parameters
IConnection
conn
The connection. |
Returns
System.Int32
|
SetConnectionPoints(IConnection, IEnumerable<Point>)
Sets the connection points.
Declaration
public static void SetConnectionPoints(this IConnection connection, IEnumerable<Point> connectionPoints)
Parameters
IConnection
connection
The connection. |
System.Collections.Generic.IEnumerable<Point>
connectionPoints
The connection points. |
TranslateConnectionPoints(IConnection, Boolean)
Shifts the ConnectionPoints by adding or substracting the Position vector.
Declaration
public static IEnumerable<Point> TranslateConnectionPoints(this IConnection connection, bool globalCoordinates = true)
Parameters
IConnection
connection
The connection. to shift. |
System.Boolean
globalCoordinates
If set to |
Returns
System.Collections.Generic.IEnumerable<Point>
|
Remarks
The start/end points are not taken into account here.