New to Telerik UI for WPF? Start a free 30-day trial

Span

Struct

Represents a document span.

Definition

Namespace:Telerik.Windows.SyntaxEditor.Core.Text

Assembly:Telerik.Windows.SyntaxEditor.Core.dll

Syntax:

C#
public struct Span

Constructors

Initializes a new instance of the Span struct.

C#
public Span(int start, int length)
Parameters:startintlengthint

Fields

Empty span.

C#
public static readonly Span Empty

Properties

Gets the end of the span.

C#
public int End { get; }

Gets a value indicating whether the span is empty.

C#
public bool IsEmpty { get; }

Gets the length of this span.

C#
public readonly int Length { get; }

Gets the start of the span.

C#
public readonly int Start { get; }

Methods

Checks if the given position in contained in the span.

C#
public bool Contains(int position)
Parameters:positionintReturns:

bool

Checks if the given span in contained in this span instance.

C#
public bool Contains(Span span)
Parameters:spanSpanReturns:

bool

Equals implementation.

C#
public override bool Equals(object obj)
Parameters:objobjectReturns:

bool

Overrides: ValueType.Equals(object)

Initializes a new instance of the Span struct from start and end.

C#
public static Span FromBounds(int start, int end)
Parameters:startintendintReturns:

Span

C#
public override int GetHashCode()
Returns:

int

Overrides: ValueType.GetHashCode()

Gets the Span that is result from the intersection of the given span parameter instance and this span instance.

C#
public Span? Intersection(Span span)
Parameters:spanSpanReturns:

Span?

Checks if the given span intersects with this span instance.

C#
public bool IntersectsWith(Span span)
Parameters:spanSpanReturns:

bool

Gets the Span which is a result from the overlap of the given span parameter instance and this span instance.

C#
public Span? Overlap(Span span)
Parameters:spanSpanReturns:

Span?

Checks if the given span overlaps with this span instance.

C#
public bool OverlapsWith(Span span)
Parameters:spanSpanReturns:

bool

C#
public override string ToString()
Returns:

string

Overrides: ValueType.ToString()

Operators

Implementation of != operator.

C#
public static bool operator !=(Span left, Span right)
Parameters:leftSpanrightSpanReturns:

bool

Implementation of == operator.

C#
public static bool operator ==(Span left, Span right)
Parameters:leftSpanrightSpanReturns:

bool