ITextBufferEdit::Apply Method ()

 

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.

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

ITextSnapshot^ Apply()

Return Value

Type: Microsoft.VisualStudio.Text::ITextSnapshot^

A snapshot of the state of the ITextBuffer after the change is applied. If there was no change, or edit was canceled, no new snapshot will be generated, and the previous snapshot will be returned.

Exception Condition
InvalidOperationException

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

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

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.

Return to top
Show: