ITextBuffer.IsReadOnly Method

Definition

Overloads

IsReadOnly(Span)

Determines whether a text modification or deletion would be prohibited at span due to an IReadOnlyRegion

IsReadOnly(Int32)

Determines whether a text insertion would be prohibited at position due to an IReadOnlyRegion.

IsReadOnly(Span, Boolean)

Determines whether a text modification or deletion would be prohibited at span due to an IReadOnlyRegion

IsReadOnly(Int32, Boolean)

Determines whether a text insertion would be prohibited at position due to an IReadOnlyRegion.

IsReadOnly(Span)

Determines whether a text modification or deletion would be prohibited at span due to an IReadOnlyRegion

C++/CX
public:
 bool IsReadOnly(Microsoft::VisualStudio::Text::Span span);

Parameters

span
Span

The span to check.

Returns

true if the entire span could be deleted or replaced, otherwise false.

Exceptions

span is null.

The End property of span is greater than CurrentSnapshot.Length.

TakeThreadOwnership() has previously been called, and this call is being made from a different thread.

Applies to

Visual Studio SDK 2022 and other versions
Product Versions
Visual Studio SDK 2015, 2017, 2019, 2022

IsReadOnly(Int32)

Determines whether a text insertion would be prohibited at position due to an IReadOnlyRegion.

C++/CX
public:
 bool IsReadOnly(int position);

Parameters

position
Int32

The position of the proposed text insertion.

Returns

true if an IReadOnlyRegion would prohibit insertions at this position, otherwise false.

Exceptions

position is negative or greater than CurrentSnapshot.Length.

TakeThreadOwnership() has previously been called, and this call is being made from a different thread.

Applies to

Visual Studio SDK 2022 and other versions
Product Versions
Visual Studio SDK 2015, 2017, 2019, 2022

IsReadOnly(Span, Boolean)

Determines whether a text modification or deletion would be prohibited at span due to an IReadOnlyRegion

C++/CX
public:
 bool IsReadOnly(Microsoft::VisualStudio::Text::Span span, bool isEdit);

Parameters

span
Span

The span to check.

isEdit
Boolean

true if this check is part of an edit. false for a query without side effects.

Returns

true if the entire span could be deleted or replaced, false otherwise.

Exceptions

span is null.

The End property of span is greater than CurrentSnapshot.Length.

TakeThreadOwnership() has previously been called, and this call is being made from a different thread.

Applies to

Visual Studio SDK 2022 and other versions
Product Versions
Visual Studio SDK 2015, 2017, 2019, 2022

IsReadOnly(Int32, Boolean)

Determines whether a text insertion would be prohibited at position due to an IReadOnlyRegion.

C++/CX
public:
 bool IsReadOnly(int position, bool isEdit);

Parameters

position
Int32

The position of the proposed text insertion.

isEdit
Boolean

true if this check is part of an edit. false for a query without side effects.

Returns

true if an IReadOnlyRegion would prohibit insertions at this position, otherwise false.

Exceptions

position is negative or greater than CurrentSnapshot.Length.

TakeThreadOwnership() has previously been called, and this call is being made from a different thread.

Applies to

Visual Studio SDK 2022 and other versions
Product Versions
Visual Studio SDK 2015, 2017, 2019, 2022