Partager via


ITextEdit Interface

Represents a set of editing operations on an ITextBuffer.

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

Syntax

'Declaration
Public Interface ITextEdit _
    Inherits ITextBufferEdit, IDisposable
public interface ITextEdit : ITextBufferEdit, 
    IDisposable
public interface class ITextEdit : ITextBufferEdit, 
    IDisposable
type ITextEdit =  
    interface 
        interface ITextBufferEdit 
        interface IDisposable 
    end
public interface ITextEdit extends ITextBufferEdit, IDisposable

The ITextEdit type exposes the following members.

Properties

  Name Description
Public property Canceled Determines whether this edit has been canceled. (Inherited from ITextBufferEdit.)
Public property HasEffectiveChanges Determines whether the edit has changes in non-read-only regions.
Public property HasFailedChanges Determines whether any changes failed to be added to this edit due to read-only regions.
Public property Snapshot Gets a snapshot of the ITextBuffer at the time this object was created. (Inherited from ITextBufferEdit.)

Top

Methods

  Name Description
Public method Apply Commits all the modifications made with this ITextBufferEdit object to the underlying ITextBuffer. It also causes the ITextBuffer to generate a new snapshot and raise its Changed event if any modifications were made. (Inherited from ITextBufferEdit.)
Public method Cancel Abandons all modifications started using this ITextBufferEdit object. Any further calls on this object will result in an InvalidOperationException. (Inherited from ITextBufferEdit.)
Public method Delete(Span) Deletes a sequence of characters from the buffer.
Public method Delete(Int32, Int32) Deletes a sequence of characters from the buffer.
Public method Dispose Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. (Inherited from IDisposable.)
Public method Insert(Int32, String) Inserts the given text at the specified positionin the text buffer.
Public method Insert(Int32, array<Char[], Int32, Int32) Inserts an array of characters at the specified position in the ITextBuffer.
Public method Replace(Span, String) Replaces a sequence of characters with different text.
Public method Replace(Int32, Int32, String) Replaces a sequence of characters with different text.

Top

Remarks

At most one ITextBufferEdit object may be active at a given time for a particular ITextBuffer.

The positions of all edit operations are specified with respect to the state of the ITextBuffer at the time this object was created.

This object is considered active as long as it has been neither Applied nor Cancelled. Calling Dispose on an unapplied object is equivalent to calling Cancel.

The operations performed using this object are not reflected in the ITextBuffer until the Apply method has been called.

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

See Also

Reference

Microsoft.VisualStudio.Text Namespace