_DTE.UndoContext プロパティ
更新 : 2007 年 11 月
グローバル UndoContext オブジェクトを取得します。
名前空間 : EnvDTE
アセンブリ : EnvDTE (EnvDTE.dll 内)
構文
'宣言
ReadOnly Property UndoContext As UndoContext
'使用
Dim instance As _DTE
Dim value As UndoContext
value = instance.UndoContext
UndoContext UndoContext { get; }
property UndoContext^ UndoContext {
UndoContext^ get ();
}
function get UndoContext () : 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
アクセス許可
- 直前の呼び出し元に対する完全な信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。