Table of Contents

Struct TextLocation

Namespace
ICSharpCode.Decompiler.CSharp.Syntax
Assembly
ICSharpCode.Decompiler.dll

A line/column position. Text editor lines/columns are counted started from one.

[TypeConverter(typeof(TextLocationConverter))]
public struct TextLocation : IComparable<TextLocation>, IEquatable<TextLocation>
Implements
Inherited Members

Constructors

TextLocation(int, int)

Creates a TextLocation instance.

public TextLocation(int line, int column)

Parameters

line int
column int

Fields

Empty

Represents no text location (0, 0).

public static readonly TextLocation Empty

Field Value

TextLocation

MinColumn

Constant of the minimum column.

public const int MinColumn = 1

Field Value

int

MinLine

Constant of the minimum line.

public const int MinLine = 1

Field Value

int

Properties

Column

Gets the column number.

public int Column { get; }

Property Value

int

IsEmpty

Gets whether the TextLocation instance is empty.

public bool IsEmpty { get; }

Property Value

bool

Line

Gets the line number.

public int Line { get; }

Property Value

int

Methods

CompareTo(TextLocation)

Compares two text locations.

public int CompareTo(TextLocation other)

Parameters

other TextLocation

Returns

int

Equals(TextLocation)

Equality test.

public bool Equals(TextLocation other)

Parameters

other TextLocation

Returns

bool

Equals(object)

Equality test.

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

GetHashCode()

Gets a hash code.

public override int GetHashCode()

Returns

int

ToString()

Gets a string representation for debugging purposes.

public override string ToString()

Returns

string

Operators

operator ==(TextLocation, TextLocation)

Equality test.

public static bool operator ==(TextLocation left, TextLocation right)

Parameters

left TextLocation
right TextLocation

Returns

bool

operator >(TextLocation, TextLocation)

Compares two text locations.

public static bool operator >(TextLocation left, TextLocation right)

Parameters

left TextLocation
right TextLocation

Returns

bool

operator >=(TextLocation, TextLocation)

Compares two text locations.

public static bool operator >=(TextLocation left, TextLocation right)

Parameters

left TextLocation
right TextLocation

Returns

bool

operator !=(TextLocation, TextLocation)

Inequality test.

public static bool operator !=(TextLocation left, TextLocation right)

Parameters

left TextLocation
right TextLocation

Returns

bool

operator <(TextLocation, TextLocation)

Compares two text locations.

public static bool operator <(TextLocation left, TextLocation right)

Parameters

left TextLocation
right TextLocation

Returns

bool

operator <=(TextLocation, TextLocation)

Compares two text locations.

public static bool operator <=(TextLocation left, TextLocation right)

Parameters

left TextLocation
right TextLocation

Returns

bool