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.Collections.Generic.IList<System.Windows.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<System.Windows.Point, System.Windows.Point>
connectionEnds
The connection end points. |
System.Collections.Generic.IList<System.Windows.Point>
connectionPoints
The points of interest (points where the line is curved/segmented). |
Returns
System.Windows.Point
|
GetBezierDefaultHandlePoint(Point, Point, Point)
Gets the bezier default handle point.
Declaration
public static Point GetBezierDefaultHandlePoint(Point entryPoint, Point endPoint, Point connectorCenter)
Parameters
System.Windows.Point
entryPoint
The entry point. |
System.Windows.Point
endPoint
The end point (opposite of the |
System.Windows.Point
connectorCenter
The center of the connectors. |
Returns
System.Windows.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
System.Windows.Point
entryPoint
The entry point. |
System.Windows.Point
endPoint
The end point. |
System.Windows.Point
connectorCenter
The connector center. |
System.Double
bezierTension
The bezier tension. |
Returns
System.Windows.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<System.Windows.Point, System.Windows.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, Nullable<Point> sourceConnectorCenter = null, Nullable<Point> targetConnectorCenter = null)
Parameters
IConnection
connection
The connection. |
System.Windows.Point
startPoint
The cached start point. |
System.Windows.Point
endPoint
The cached end point. |
System.Nullable<System.Windows.Point>
sourceConnectorCenter
The source connector center. |
System.Nullable<System.Windows.Point>
targetConnectorCenter
The target connector center. |
Returns
System.Tuple<System.Windows.Point, System.Windows.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<System.Windows.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<System.Windows.Point>
|
Remarks
The start/end points are not taken into account here.