DTE2.UndoContext Свойство
Определение
Важно!
Некоторые сведения относятся к предварительной версии продукта, в которую до выпуска могут быть внесены существенные изменения. Майкрософт не предоставляет никаких гарантий, явных или подразумеваемых, относительно приведенных здесь сведений.
Возвращает глобальный объект UndoContext.
public:
property EnvDTE::UndoContext ^ UndoContext { EnvDTE::UndoContext ^ get(); };
public:
property EnvDTE::UndoContext ^ UndoContext { EnvDTE::UndoContext ^ get(); };
[System.Runtime.InteropServices.DispId(235)]
public EnvDTE.UndoContext UndoContext { [System.Runtime.InteropServices.DispId(235)] get; }
[<System.Runtime.InteropServices.DispId(235)>]
[<get: System.Runtime.InteropServices.DispId(235)>]
member this.UndoContext : EnvDTE.UndoContext
Public ReadOnly Property UndoContext As UndoContext
Значение свойства
Объект UndoContext.
Реализации
- Атрибуты
Примеры
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