Share via


_DTE.UndoContext 속성

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

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

구문

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

속성 값

형식: EnvDTE.UndoContext
UndoContext 개체입니다.

예제

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

.NET Framework 보안

  • 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.

참고 항목

참조

_DTE 인터페이스

EnvDTE 네임스페이스