ITextBuffer.IsReadOnly Method (Int32, Boolean)

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

Namespace:  Microsoft.VisualStudio.Text
Assembly:  Microsoft.VisualStudio.Text.Data (in Microsoft.VisualStudio.Text.Data.dll)


Function IsReadOnly ( _
    position As Integer, _
    isEdit As Boolean _
) As Boolean
bool IsReadOnly(
    int position,
    bool isEdit
bool IsReadOnly(
    int position, 
    bool isEdit
abstract IsReadOnly : 
        position:int * 
        isEdit:bool -> bool 
function IsReadOnly(
    position : int, 
    isEdit : boolean
) : boolean


  • position
    Type: System.Int32
    The position of the proposed text insertion.
  • isEdit
    Type: System.Boolean
    true if this check is part of an edit. false for a query without side effects.

Return Value

Type: System.Boolean
true if an IReadOnlyRegion would prohibit insertions at this position, otherwise false.


Exception Condition

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


position is negative or greater than the length of CurrentSnapshot.

.NET Framework Security

See Also


ITextBuffer Interface

IsReadOnly Overload

Microsoft.VisualStudio.Text Namespace