ITextBuffer ITextBuffer ITextBuffer ITextBuffer ITextBuffer ITextBuffer Interface

Definition

A mutable sequence of Unicode (UTF-16) characters.

public interface class ITextBuffer : Microsoft::VisualStudio::Utilities::IPropertyOwner
public interface class ITextBuffer : Microsoft::VisualStudio::Utilities::IPropertyOwner
__interface ITextBuffer : Microsoft::VisualStudio::Utilities::IPropertyOwner
public interface ITextBuffer : Microsoft.VisualStudio.Utilities.IPropertyOwner
type ITextBuffer = interface
    interface IPropertyOwner
Public Interface ITextBuffer
Implements IPropertyOwner
Derived
Implements

Remarks

For more information about text buffers, see the section "A Closer Look at the Text Model and the Text View" in Inside the Editor.

Positions in this buffer are treated as a sequence of characters (starting at character zero), or as a sequence of lines (starting at line zero). An empty buffer has a single line containing no characters.

Properties

ContentType ContentType ContentType ContentType ContentType ContentType

Gets the content type of the text in the buffer.

CurrentSnapshot CurrentSnapshot CurrentSnapshot CurrentSnapshot CurrentSnapshot CurrentSnapshot

Gets the current content of the buffer.

EditInProgress EditInProgress EditInProgress EditInProgress EditInProgress EditInProgress

Determines whether an edit operation is currently in progress on the ITextBuffer.

Methods

ChangeContentType(IContentType, Object) ChangeContentType(IContentType, Object) ChangeContentType(IContentType, Object) ChangeContentType(IContentType, Object) ChangeContentType(IContentType, Object) ChangeContentType(IContentType, Object)

Changes the IContentType for this ITextBuffer.

CheckEditAccess() CheckEditAccess() CheckEditAccess() CheckEditAccess() CheckEditAccess() CheckEditAccess()

Determines whether edit operations on this text buffer are permitted on the calling thread.

CreateEdit() CreateEdit() CreateEdit() CreateEdit() CreateEdit() CreateEdit()

Creates an ITextEdit object that handles compound edit operations on this buffer.

CreateEdit(EditOptions, Nullable<Int32>, Object) CreateEdit(EditOptions, Nullable<Int32>, Object) CreateEdit(EditOptions, Nullable<Int32>, Object) CreateEdit(EditOptions, Nullable<Int32>, Object) CreateEdit(EditOptions, Nullable<Int32>, Object) CreateEdit(EditOptions, Nullable<Int32>, Object)

Creates an ITextEdit object that handles compound edit operations on this buffer.

CreateReadOnlyRegionEdit() CreateReadOnlyRegionEdit() CreateReadOnlyRegionEdit() CreateReadOnlyRegionEdit() CreateReadOnlyRegionEdit() CreateReadOnlyRegionEdit()

Creates an IReadOnlyRegionEdit object that handles adding or removing read-only regions from this buffer.

Delete(Span) Delete(Span) Delete(Span) Delete(Span) Delete(Span) Delete(Span)

Deletes a sequence of characters from the buffer.

GetReadOnlyExtents(Span) GetReadOnlyExtents(Span) GetReadOnlyExtents(Span) GetReadOnlyExtents(Span) GetReadOnlyExtents(Span) GetReadOnlyExtents(Span)

Gets a list of read-only regions that overlap the given span.

Insert(Int32, String) Insert(Int32, String) Insert(Int32, String) Insert(Int32, String) Insert(Int32, String) Insert(Int32, String)

Inserts the given text at the specified position in the ITextBuffer.

IsReadOnly(Span) IsReadOnly(Span) IsReadOnly(Span) IsReadOnly(Span) IsReadOnly(Span) IsReadOnly(Span)

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

IsReadOnly(Int32) IsReadOnly(Int32) IsReadOnly(Int32) IsReadOnly(Int32) IsReadOnly(Int32) IsReadOnly(Int32)

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

IsReadOnly(Span, Boolean) IsReadOnly(Span, Boolean) IsReadOnly(Span, Boolean) IsReadOnly(Span, Boolean) IsReadOnly(Span, Boolean) IsReadOnly(Span, Boolean)

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

IsReadOnly(Int32, Boolean) IsReadOnly(Int32, Boolean) IsReadOnly(Int32, Boolean) IsReadOnly(Int32, Boolean) IsReadOnly(Int32, Boolean) IsReadOnly(Int32, Boolean)

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

Replace(Span, String) Replace(Span, String) Replace(Span, String) Replace(Span, String) Replace(Span, String) Replace(Span, String)

Replaces a sequence of characters with different text. This is equivalent to first deleting the text to be replaced and then inserting the new text.

TakeThreadOwnership() TakeThreadOwnership() TakeThreadOwnership() TakeThreadOwnership() TakeThreadOwnership() TakeThreadOwnership()

Claims ownership of this buffer for the current thread. All subsequent modifications of this ITextBuffer must be made from the current thread, or else an InvalidOperationException will be raised.

Events

Changed Changed Changed Changed Changed Changed

Occurs when a non-empty ITextEdit is successfully applied.

ChangedHighPriority ChangedHighPriority ChangedHighPriority ChangedHighPriority ChangedHighPriority ChangedHighPriority

Occurs when a non-empty ITextEdit is successfully applied.

ChangedLowPriority ChangedLowPriority ChangedLowPriority ChangedLowPriority ChangedLowPriority ChangedLowPriority

Occurs when a non-empty ITextEdit is successfully applied.

Changing Changing Changing Changing Changing Changing

Occurs just before a non-empty ITextEdit is applied.

ContentTypeChanged ContentTypeChanged ContentTypeChanged ContentTypeChanged ContentTypeChanged ContentTypeChanged

Occurs whenever the IContentType has been changed.

PostChanged PostChanged PostChanged PostChanged PostChanged PostChanged

Occurs after the Changed event and any resulting edits.

ReadOnlyRegionsChanged ReadOnlyRegionsChanged ReadOnlyRegionsChanged ReadOnlyRegionsChanged ReadOnlyRegionsChanged ReadOnlyRegionsChanged

Occurs when a IReadOnlyRegionEdit has created or removed read-only regions.

Applies to