Class ConnectionUtilities
Utilities and extension methods related to connections.
Inheritance
Namespace: Telerik.Windows.Diagrams.Core
Assembly: Telerik.Windows.Diagrams.Core.dll
Syntax
public static class ConnectionUtilities : Object
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.
|
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. The connection end points. |
System. The points of interest (points where the line is curved/segmented). |
Returns
System.
|
GetBezierDefaultHandlePoint(Point, Point, Point)
Gets the bezier default handle point.
Declaration
public static Point GetBezierDefaultHandlePoint(Point entryPoint, Point endPoint, Point connectorCenter)
Parameters
System. The entry point. |
System. The end point (opposite of the |
System. The center of the connectors. |
Returns
System.
|
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
System. The entry point. |
System. The end point. |
System. The connector center. |
System. The bezier tension. |
Returns
System.
|
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. If set to |
Returns
System.
|
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, Nullable<Point> sourceConnectorCenter = null, Nullable<Point> targetConnectorCenter = null)
Parameters
IConnection
connection
The connection. |
System. The cached start point. |
System. The cached end point. |
System. The source connector center. |
System. The target connector center. |
Returns
System.
|
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.
|
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. The connection points. |
TranslateConnectionPoints(IConnection, Boolean)
Shifts the Connection
Declaration
public static IEnumerable<Point> TranslateConnectionPoints(this IConnection connection, bool globalCoordinates = true)
Parameters
IConnection
connection
The connection. to shift. |
System. If set to |
Returns
System.
|
Remarks
The start/end points are not taken into account here.