NetDiagram Programmer's Guide
DiagramLink Class
Remarks See Also
 





Represents a link between two diagram nodes.

Namespace: MindFusion.Diagramming
Package: MindFusion.Diagramming

 Syntax

C#  Copy Code

public class DiagramLink : DiagramItem, Routable, IAnimationItem

Visual Basic  Copy Code

Public Class DiagramLink
    Inherits DiagramItem
    Implements Routable, IAnimationItem

 Remarks

Links between nodes in NetDiagram diagrams are represented by instances of the DiagramLink class. Links connect at most two nodes, which can be accessed with the Origin and Destination properties. If connected to node anchor points, the point indices can be accessed using the OriginAnchor and DestinationAnchor properties. To control whether users are allowed to move link end points, set AllowMoveStart and AllowMoveEnd.

Links are built of smaller parts called segments, which can be straight lines, cascading orthogonal lines, Bézier or spline curves. The type of segments is set through the Shape property. The number of link's segments is specified by the SegmentCount property. Access to control point locations is provided by the ControlPoints collection.

Usually only the starting and ending segments of a link are updated if the nodes it connects are moved around. Number, orientation and/or position of link segments can change dynamically in various ways depending on the values of AutoRoute, Dynamic and RetainForm. For links of style Cascading, the CascadeOrientation property specifies the orientation of their first segments.

If AutoSnapToNode is enabled, a link automatically aligns its end points to the border of the origin or destination nodes when a user moves the first or last control points. This has a higher priority than aligning to the grid, but a lower priority than aligning to an anchor point.

Links can display distinct arrowhead shapes at their ends. These shapes can be set with the HeadShape and BaseShape properties. The size of the base and arrowhead images is specified through the HeadShapeSize and BaseShapeSize properties. Arrowhead shapes can be displayed in the middle of each segment to facilitate users by distinguishing different links. The type and size of these shapes is set with the IntermediateShape and IntermediateShapeSize properties. The lines of arowhead shapes are painted using the HeadPen pen.

The color of link segments can be specified by the Pen property and the fill color of its base and head shapes with the BaseBrush and HeadBrush properties. The appearance of link's selection handles can be changed using HandlesStyle.

Links can have some text associated with them, displayed as specified via the Text, TextBrush and TextStyle properties. The AddLabel method allows displaying multiple labels per link. Labels can automatically avoid overlapping nodes or other labels when their AutoArrange property is set.

Bounds and Length are informative properties returning respectively link's location and total length.

 Inheritance Hierarchy

System.Object
    MindFusion.Diagramming.DiagramItem
        MindFusion.Diagramming.DiagramLink

 See Also

DiagramLink Members
MindFusion.Diagramming Namespace