Class BufferPosition
Provides details about a position in a file buffer. All positions are expressed in 1-based positions (i.e. the first line and column in the file is position 1,1).
Inheritance
Namespace:Microsoft.SqlTools.ServiceLayer.Workspace.Contracts
Assembly:Microsoft.SqlTools.ServiceLayer.dll
Syntax
public class BufferPosition
Constructors
| Improve this Doc View SourceBufferPosition(Int32, Int32)
Creates a new instance of the BufferPosition class.
Declaration
public BufferPosition(int line, int column)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | line | The line number of the position. |
System.Int32 | column | The column number of the position. |
Fields
| Improve this Doc View SourceNone
Provides an instance that represents a position that has not been set.
Declaration
public static readonly BufferPosition None
Properties
| Improve this Doc View SourceColumn
Gets the column number of the position in the buffer.
Declaration
public int Column { get; }
Type | Description |
---|---|
System.Int32 |
Line
Gets the line number of the position in the buffer.
Declaration
public int Line { get; }
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceEquals(Object)
Compares two instances of the BufferPosition class.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The object to which this instance will be compared. |
Returns
Type | Description |
---|---|
System.Boolean | True if the positions are equal, false otherwise. |
GetHashCode()
Calculates a unique hash code that represents this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code representing this instance. |
Operators
| Improve this Doc View SourceGreaterThan(BufferPosition, BufferPosition)
Compares two positions to check if one is greater than the other.
Declaration
public static bool operator>(BufferPosition positionOne, BufferPosition positionTwo)
Parameters
Type | Name | Description |
---|---|---|
BufferPosition | positionOne | The first position to compare. |
BufferPosition | positionTwo | The second position to compare. |
Returns
Type | Description |
---|---|
System.Boolean | True if positionOne is greater than positionTwo. |
LessThan(BufferPosition, BufferPosition)
Compares two positions to check if one is less than the other.
Declaration
public static bool operator <(BufferPosition positionOne, BufferPosition positionTwo)
Parameters
Type | Name | Description |
---|---|---|
BufferPosition | positionOne | The first position to compare. |
BufferPosition | positionTwo | The second position to compare. |
Returns
Type | Description |
---|---|
System.Boolean | True if positionOne is less than positionTwo. |