Visual Studio 2013
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Gets the global UndoContext object.
Assembly: EnvDTE80 (in EnvDTE80.dll)
Sub UndoContextExample() Dim selection As TextSelection = DTE2.ActiveDocument.Selection() Dim start As EditPoint = selection.TopPoint.CreateEditPoint() Dim endpt As TextPoint = selection.BottomPoint Dim commentStart As String DTE2.UndoContext.Open("Comment Region") Try Do While (start.LessThan(endpt)) start.Insert(commentStart) start.LineDown() start.StartOfLine() Loop Finally ' If an error occured, then need to make sure that the undo ' context is cleaned up. Otherwise, the editor can be left in a ' perpetual undo context. DTE2.UndoContext.Close() End Try End Sub
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.