Propriedade _DTE.UndoContext
Obtém o objeto global UndoContext.
Namespace: EnvDTE
Assembly: EnvDTE (em EnvDTE. dll)
ReadOnly Property UndoContext As UndoContext
Dim instance As _DTE
Dim value As UndoContext
value = instance.UndoContext
UndoContext UndoContext { get; }
property UndoContext^ UndoContext {
UndoContext^ get ();
}
function get UndoContext () : UndoContext
Tipo: EnvDTE.UndoContext
A UndoContext object.
Sub UndoContextExample()
Dim selection As TextSelection = DTE.ActiveDocument.Selection()
Dim start As EditPoint = selection.TopPoint.CreateEditPoint()
Dim endpt As TextPoint = selection.BottomPoint
Dim commentStart As String
DTE.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.
DTE.UndoContext.Close()
End Try
End Sub
- Confiar total para o chamador imediato. Este membro não pode ser usado pelo código parcialmente confiável. Para obter mais informações, consulte Usando bibliotecas de códigos parcialmente Confiável.