다음을 통해 공유


DTE2.UndoContext 속성

전역 UndoContext 개체를 가져옵니다.

네임스페이스:  EnvDTE80
어셈블리:  EnvDTE80(EnvDTE80.dll)

구문

‘선언
ReadOnly Property UndoContext As UndoContext
UndoContext UndoContext { get; }
property UndoContext^ UndoContext {
    UndoContext^ get ();
}
abstract UndoContext : UndoContext with get
function get UndoContext () : UndoContext

속성 값

형식: 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

.NET Framework 보안

참고 항목

참조

DTE2 인터페이스

EnvDTE80 네임스페이스