ITextUndoHistory 接口

包含撤消事务。

命名空间:  Microsoft.VisualStudio.Text.Operations
程序集:  Microsoft.VisualStudio.Text.Logic(在 Microsoft.VisualStudio.Text.Logic.dll 中)

语法

声明
Public Interface ITextUndoHistory _
    Inherits IPropertyOwner
public interface ITextUndoHistory : IPropertyOwner
public interface class ITextUndoHistory : IPropertyOwner
type ITextUndoHistory =  
    interface 
        interface IPropertyOwner 
    end
public interface ITextUndoHistory extends IPropertyOwner

ITextUndoHistory 类型公开以下成员。

属性

  名称 说明
公共属性 CanRedo 确定是否可以执行一个重做操作。
公共属性 CanUndo 确定是否可以执行一个撤消操作。
公共属性 CurrentTransaction 获取当前取消正在进行的事务。
公共属性 LastRedoTransaction 获取 RedoStack的最新 (顶部) 项。
公共属性 LastUndoTransaction 获取 UndoStack的最新 (顶部) 项。
公共属性 Properties 获取属性所有者控制的属性集合。 (继承自 IPropertyOwner。)
公共属性 RedoDescription 获取最新可见重做 ITextUndoTransaction 的说明。
公共属性 RedoStack 此历史记录的重做堆栈。该堆栈不包含任何当前处于打开状态的事务或撤消事务。
公共属性 State 获取撤消历史记录的当前状态。
公共属性 UndoDescription 获取最新可见撤消 ITextUndoTransaction 的说明。
公共属性 UndoStack 此历史记录的撤消堆栈。该堆栈不包含任何当前处于打开状态的事务或重做事务。

页首

方法

  名称 说明
公共方法 CreateTransaction 创建新的事务,将其嵌套在之前的当前事务中,并将其标记为当前事务。
公共方法 Redo 执行指定数目的重做操作,并将事务放置到撤消堆栈上。
公共方法 Undo 执行指定数目的撤消操作,并将事务放置到重做堆栈上。

页首

事件

  名称 说明
公共事件 UndoRedoHappened 当对此历史记录执行撤消或重做操作时,向使用者发出通知。
公共事件 UndoTransactionCompleted 当执行完 ITextUndoTransaction 并将其添加到 UndoStack 中时,向使用者发出通知。

页首

备注

通常只有一个撤消事务历史记录每个可由用户。

请参阅

参考

Microsoft.VisualStudio.Text.Operations 命名空间