Show / Hide Table of Contents

# Class BufferRange

Provides details about a range between two positions in a file buffer.

##### Inheritance

System.Object
BufferRange

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

### Constructors

| Improve this Doc View Source

#### BufferRange(BufferPosition, BufferPosition)

Creates a new instance of the BufferRange class.

##### Declaration

    public BufferRange(BufferPosition start, BufferPosition end)

##### Parameters

Type | Name | Description
--- | --- | ---
BufferPosition | start | The start position of the range.
BufferPosition | end | The end position of the range.

| Improve this Doc View Source

#### BufferRange(Int32, Int32, Int32, Int32)

Creates a new instance of the BufferRange class.

##### Declaration

    public BufferRange(int startLine, int startColumn, int endLine, int endColumn)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Int32 | startLine | The 1-based starting line number of the range.
System.Int32 | startColumn | The 1-based starting column number of the range.
System.Int32 | endLine | The 1-based ending line number of the range.
System.Int32 | endColumn | The 1-based ending column number of the range.

### Fields

| Improve this Doc View Source

#### None

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

##### Declaration

    public static readonly BufferRange None

##### Field Value

Type | Description
--- | ---
BufferRange |

### Properties

| Improve this Doc View Source

#### End

Gets the end position of the range in the buffer.

##### Declaration

    public BufferPosition End { get; }

##### Property Value

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

| Improve this Doc View Source

#### HasRange

Returns true if the current range is non-zero, i.e. contains valid start and end positions.

##### Declaration

    public bool HasRange { get; }

##### Property Value

Type | Description
--- | ---
System.Boolean |

| Improve this Doc View Source

#### Start

Gets the start position of the range in the buffer.

##### Declaration

    public BufferPosition Start { get; }

##### Property Value

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

### Methods

| Improve this Doc View Source

#### Equals(Object)

Compares two instances of the BufferRange 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 ranges 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()