Struct
Span

Represents a document span.

Definition

Namespace:Telerik.Windows.SyntaxEditor.Core.Text

Assembly:Telerik.Windows.SyntaxEditor.Core.dll

Syntax:

cs-api-definition
public struct Span

Constructors

Span(int, int)

Initializes a new instance of the Span struct.

Declaration

cs-api-definition
public Span(int start, int length)

Parameters

start

int

length

int

Fields

Empty

Empty span.

Declaration

cs-api-definition
public static readonly Span Empty

Field Value

Span

Properties

End

Gets the end of the span.

Declaration

cs-api-definition
public int End { get; }

Property Value

int

IsEmpty

Gets a value indicating whether the span is empty.

Declaration

cs-api-definition
public bool IsEmpty { get; }

Property Value

bool

Length

Gets the length of this span.

Declaration

cs-api-definition
public readonly int Length { get; }

Property Value

int

Start

Gets the start of the span.

Declaration

cs-api-definition
public readonly int Start { get; }

Property Value

int

Methods

Contains(Span)

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

Declaration

cs-api-definition
public bool Contains(Span span)

Parameters

span

Span

Returns

bool

Contains(int)

Checks if the given position in contained in the span.

Declaration

cs-api-definition
public bool Contains(int position)

Parameters

position

int

Returns

bool

Equals(object)

Equals implementation.

Declaration

cs-api-definition
public override bool Equals(object obj)

Parameters

obj

object

Returns

bool

Overrides ValueType.Equals(object)

FromBounds(int, int)

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

Declaration

cs-api-definition
public static Span FromBounds(int start, int end)

Parameters

start

int

end

int

Returns

Span

GetHashCode()

Declaration

cs-api-definition
public override int GetHashCode()

Returns

int

Overrides ValueType.GetHashCode()

Intersection(Span)

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

Declaration

cs-api-definition
public Span? Intersection(Span span)

Parameters

span

Span

Returns

Span?

IntersectsWith(Span)

Checks if the given span intersects with this span instance.

Declaration

cs-api-definition
public bool IntersectsWith(Span span)

Parameters

span

Span

Returns

bool

Overlap(Span)

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

Declaration

cs-api-definition
public Span? Overlap(Span span)

Parameters

span

Span

Returns

Span?

OverlapsWith(Span)

Checks if the given span overlaps with this span instance.

Declaration

cs-api-definition
public bool OverlapsWith(Span span)

Parameters

span

Span

Returns

bool

ToString()

Declaration

cs-api-definition
public override string ToString()

Returns

string

Overrides ValueType.ToString()

Operators

operator !=(Span, Span)

Implementation of != operator.

Declaration

cs-api-definition
public static bool operator !=(Span left, Span right)

Parameters

left

Span

right

Span

Returns

bool

operator ==(Span, Span)

Implementation of == operator.

Declaration

cs-api-definition
public static bool operator ==(Span left, Span right)

Parameters

left

Span

right

Span

Returns

bool