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
Defines whether the segment can be dragged or not.
Declaration
public bool AllowDrag { get; set; }
Property Value
Type |
---|
System.Boolean |
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)},
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