_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 名前空間