Struct LinePosition
Immutable representation of a line number and position within a SourceText instance.
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Assembly: Loretta.CodeAnalysis.dll
Syntax
[DataContract]
public readonly struct LinePosition
Constructors
|
Improve this Doc
View Source
LinePosition(Int32, Int32)
Initializes a new instance of a LinePosition with the given line and character.
Declaration
public LinePosition(int line, int character)
Parameters
Type |
Name |
Description |
System.Int32 |
line |
The line of the line position. The first line in a file is defined as line 0 (zero based line numbering).
|
System.Int32 |
character |
The character position in the line.
|
Properties
|
Improve this Doc
View Source
Character
The character position within the line.
Declaration
public readonly int Character { get; }
Property Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Line
The line number. The first line in a file is defined as line 0 (zero based line numbering).
Declaration
public readonly int Line { get; }
Property Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Zero
Declaration
public static readonly LinePosition Zero { get; }
Property Value
Methods
|
Improve this Doc
View Source
CompareTo(LinePosition)
Declaration
public readonly int CompareTo(LinePosition other)
Parameters
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Equals(LinePosition)
Declaration
public readonly bool Equals(LinePosition other)
Parameters
Type |
Name |
Description |
LinePosition |
other |
The object to compare.
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Equals(Object)
Declaration
public override readonly bool Equals(object obj)
Parameters
Type |
Name |
Description |
System.Object |
obj |
The object to compare.
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
System.ValueType.Equals(System.Object)
|
Improve this Doc
View Source
GetHashCode()
Declaration
public override readonly int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
Overrides
System.ValueType.GetHashCode()
|
Improve this Doc
View Source
ToString()
Declaration
public override readonly string ToString()
Returns
Type |
Description |
System.String |
|
Overrides
System.ValueType.ToString()
Examples
0,10
Operators
|
Improve this Doc
View Source
Equality(LinePosition, LinePosition)
Declaration
public static bool operator ==(LinePosition left, LinePosition right)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
GreaterThan(LinePosition, LinePosition)
Checks whether one position is located after another.
Declaration
public static bool operator>(LinePosition left, LinePosition right)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
GreaterThanOrEqual(LinePosition, LinePosition)
Checks whether one position is located after or at the same location as another.
Declaration
public static bool operator >=(LinePosition left, LinePosition right)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Inequality(LinePosition, LinePosition)
Declaration
public static bool operator !=(LinePosition left, LinePosition right)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
LessThan(LinePosition, LinePosition)
Checks whether one position is located before another.
Declaration
public static bool operator <(LinePosition left, LinePosition right)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
LessThanOrEqual(LinePosition, LinePosition)
Checks whether one position is located before or at the same location as another.
Declaration
public static bool operator <=(LinePosition left, LinePosition right)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Implements
IEquatable<>
IComparable<>