Compartir a través de


DTE2.UndoContext (Propiedad)

Obtiene el objeto UndoContext global.

Espacio de nombres:  EnvDTE80
Ensamblado:  EnvDTE80 (en EnvDTE80.dll)

Sintaxis

'Declaración
ReadOnly Property UndoContext As UndoContext
    Get
UndoContext UndoContext { get; }
property UndoContext^ UndoContext {
    UndoContext^ get ();
}
abstract UndoContext : UndoContext
function get UndoContext () : UndoContext

Valor de propiedad

Tipo: EnvDTE.UndoContext
Un objeto UndoContext.

Implementaciones

_DTE.UndoContext

Ejemplos

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

Seguridad de .NET Framework

Vea también

Referencia

DTE2 Interfaz

UndoContext (Sobrecarga)

EnvDTE80 (Espacio de nombres)