Właściwość _DTE.UndoContext —

Pobiera global UndoContext obiektu.

Przestrzeń nazw:  EnvDTE
Zestaw:  EnvDTE (w EnvDTE.dll)

Składnia

'Deklaracja
ReadOnly Property UndoContext As UndoContext
UndoContext UndoContext { get; }
property UndoContext^ UndoContext {
    UndoContext^ get ();
}
abstract UndoContext : UndoContext with get
function get UndoContext () : UndoContext

Wartość właściwości

Typ: EnvDTE.UndoContext
Obiekt UndoContext.

Przykłady

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

Zabezpieczenia programu .NET Framework

Zobacz też

Informacje

_DTE Interfejs

Przestrzeń nazw EnvDTE