Class ConnectorSegment
Represents the segment of the connector.
Inherited Members
Namespace: Syncfusion.Blazor.Diagram
Assembly: Syncfusion.Blazor.dll
Syntax
public class ConnectorSegment : DiagramObject, IDiagramObject, ICloneable
Examples
<SfDiagramComponent Connectors="@connectors">
</SfDiagramComponent>
@code
{
public DiagramObjectCollection<Connector> connectors = new DiagramObjectCollection<Connector>();
protected override void OnInitialized()
{
Connector connector = new Connector()
{
ID="straight",
SourcePoint = new DiagramPoint() { X = 100, Y = 200 },
TargetPoint = new DiagramPoint() { X = 300, Y = 200 },
Segments = new DiagramObjectCollection<ConnectorSegment>()
{
//Create a new straight segment
new StraightSegment(){Point=new DiagramPoint(420,300)},
}
};
connectors.Add(connector);
}
}
Constructors
ConnectorSegment()
Initializes a new instance of the ConnectorSegment.
Declaration
public ConnectorSegment()
ConnectorSegment(ConnectorSegment)
Creates a new instance of the ConnectorSegment from the given ConnectorSegment.
Declaration
public ConnectorSegment(ConnectorSegment src)
Parameters
Type | Name | Description |
---|---|---|
ConnectorSegment | src | ConnectorSegment |
Properties
AllowDrag
Specifies whether the orthogonal segment thumb can be dragged. The default value is true
.
Declaration
public bool AllowDrag { get; set; }
Property Value
Type |
---|
System.Boolean |
Remarks
This property applies only to orthogonal connectors.
Examples
The following example demonstrates how to enable dragging for an orthogonal segment thumb:
@code {
protected override void OnInitialized()
{
Connector connector = new Connector()
{
ID = "orthogonal",
Type = ConnectorSegmentType.Orthogonal,
SourcePoint = new DiagramPoint() { X = 500, Y = 200 },
TargetPoint = new DiagramPoint() { X = 600, Y = 300 },
Constraints = ConnectorConstraints.Default | ConnectorConstraints.DragSegmentThumb,
Segments = new DiagramObjectCollection<ConnectorSegment>()
{
// Create a new orthogonal segment with dragging enabled
new OrthogonalSegment() { Length = 100, AllowDrag = true }
}
};
connectors.Add(connector);
}
}
Type
Defines the type of the segment.
Declaration
public ConnectorSegmentType Type { get; set; }
Property Value
Type |
---|
ConnectorSegmentType |
Examples
<SfDiagramComponent Connectors="@connectors">
</SfDiagramComponent>
@code
{
public DiagramObjectCollection<Connector> connectors = new DiagramObjectCollection<Connector>();
protected override void OnInitialized()
{
Connector connector = new Connector()
{
ID="straight",
Type = ConnectorSegmentType.Straight,
SourcePoint = new DiagramPoint() { X = 100, Y = 200 },
TargetPoint = new DiagramPoint() { X = 300, Y = 200 },
Segments = new DiagramObjectCollection<ConnectorSegment>()
{
//Create a new straight segment
new StraightSegment(){Point=new DiagramPoint(420,300)},
}
};
connectors.Add(connector);
}
}
Methods
Clone()
Creates a new segment that is a copy of the current segment.
Declaration
public override object Clone()
Returns
Type | Description |
---|---|
System.Object | ConnectorSegment |
Overrides
Implements
System.ICloneable