Show / Hide Table of Contents

# 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

System.Object
BufferPosition
FilePosition

##### Inherited Members

System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()

###### Namespace:Microsoft.SqlTools.ServiceLayer.Workspace.Contracts

###### Assembly:Microsoft.SqlTools.ServiceLayer.dll

##### Syntax

    public class BufferPosition

### Constructors

| Improve this Doc View Source

#### BufferPosition(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 Source

#### None

Provides an instance that represents a position that has not been set.

##### Declaration

    public static readonly BufferPosition None

##### Field Value

Type | Description
--- | ---
BufferPosition |

### Properties

| Improve this Doc View Source

#### Column

Gets the column number of the position in the buffer.

##### Declaration

    public int Column { get; }

##### Property Value

Type | Description
--- | ---
System.Int32 |

| Improve this Doc View Source

#### Line

Gets the line number of the position in the buffer.

##### Declaration

    public int Line { get; }

##### Property Value

Type | Description
--- | ---
System.Int32 |

### Methods

| Improve this Doc View Source

#### Equals(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.

##### Overrides

System.Object.Equals(System.Object)
| Improve this Doc View Source

#### 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.

##### Overrides

System.Object.GetHashCode()

### Operators

| Improve this Doc View Source

#### GreaterThan(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.

| Improve this Doc View Source

#### 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.