menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class StraightSegment - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class StraightSegment

    Represents how a straight segment can be created for a connector.

    Inheritance
    System.Object
    DiagramObject
    ConnectorSegment
    StraightSegment
    BezierSegment
    Implements
    IDiagramObject
    System.ICloneable
    Inherited Members
    ConnectorSegment.AllowDrag
    ConnectorSegment.Type
    DiagramObject.GetParent()
    DiagramObject.OnPropertyChanged(String, Object, Object, IDiagramObject)
    Namespace: Syncfusion.Blazor.Diagram
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class StraightSegment : ConnectorSegment, 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

    StraightSegment()

    Initializes a new instance of the StraightSegment.

    Declaration
    public StraightSegment()

    StraightSegment(StraightSegment)

    Creates a new instance of the StraightSegment from the given StraightSegment.

    Declaration
    public StraightSegment(StraightSegment src)
    Parameters
    Type Name Description
    StraightSegment src

    StraightSegment

    Properties

    Point

    Gets or sets the endpoint of the connector segment.

    Declaration
    public DiagramPoint Point { get; set; }
    Property Value
    Type
    DiagramPoint
    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);
      }
     }

    Methods

    Clone()

    Creates a new segment that is a copy of the current straight segment.

    Declaration
    public override object Clone()
    Returns
    Type Description
    System.Object

    StraightSegment

    Overrides
    ConnectorSegment.Clone()

    Implements

    IDiagramObject
    System.ICloneable
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved