共用方式為


ITextBufferEdit.Apply Method

Definition

Commits all the modifications made with this ITextBufferEdit object to the underlying ITextBuffer. Depending on the type of edit, it may also cause the ITextBuffer to generate a new snapshot and raise its Changed event if any modifications were made. This method may be called only once. After it is called, any other calls on this object (other than Dispose) will result in an InvalidOperationException.

public:
 Microsoft::VisualStudio::Text::ITextSnapshot ^ Apply();
public:
 Microsoft::VisualStudio::Text::ITextSnapshot ^ Apply();
Microsoft::VisualStudio::Text::ITextSnapshot Apply();
public Microsoft.VisualStudio.Text.ITextSnapshot Apply ();
abstract member Apply : unit -> Microsoft.VisualStudio.Text.ITextSnapshot
Public Function Apply () As ITextSnapshot

Returns

A snapshot of the state of the ITextBuffer after the change is applied. If there was no change, or edit was canceled, or the edit is of a type that does not generate snapshots, no new snapshot will be created, and the previous snapshot will be returned.

Exceptions

The Apply() or Cancel() or Dispose() method has previously been called on this object.

Remarks

Canceled will be true after this method returns if a handler of the buffer's Changing event canceled the change.

Applies to