Compartilhar via


Propriedade DTE2.UndoContext

Obtém o global UndoContext objeto.

Namespace:  EnvDTE80
Assembly:  EnvDTE80 (em EnvDTE80.dll)

Sintaxe

'Declaração
ReadOnly Property UndoContext As UndoContext
UndoContext UndoContext { get; }
property UndoContext^ UndoContext {
    UndoContext^ get ();
}
abstract UndoContext : UndoContext with get
function get UndoContext () : UndoContext

Valor de propriedade

Tipo: UndoContext
A UndoContext object.

Exemplos

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

Segurança do .NET Framework

Consulte também

Referência

DTE2 Interface

Namespace EnvDTE80