次の方法で共有


IVsUndoUnit Interface

Definition

Determines if the undo unit applies to UI items only.

public interface class IVsUndoUnit
public interface class IVsUndoUnit
__interface IVsUndoUnit
[System.Runtime.InteropServices.Guid("A8C3D107-7EDF-4B1B-8A81-080AC91590E9")]
[System.Runtime.InteropServices.InterfaceType(1)]
public interface IVsUndoUnit
[System.Runtime.InteropServices.Guid("A8C3D107-7EDF-4B1B-8A81-080AC91590E9")]
[System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)]
public interface IVsUndoUnit
[<System.Runtime.InteropServices.Guid("A8C3D107-7EDF-4B1B-8A81-080AC91590E9")>]
[<System.Runtime.InteropServices.InterfaceType(1)>]
type IVsUndoUnit = interface
[<System.Runtime.InteropServices.Guid("A8C3D107-7EDF-4B1B-8A81-080AC91590E9")>]
[<System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)>]
type IVsUndoUnit = interface
Public Interface IVsUndoUnit
Derived
Attributes

Remarks

Interface exposed by IOleUndoUnit or IOleParentUndoUnit if UI-only undo items (like text selection and/or caret movements) are going to be put on the undo stack. The UI only undo units do not reset the redo stack. Normally, when a new undo unit is added to the undo stack, the redo stack is cleared. However, if the undo unit is not a data changing undo, then you can use IOleUndoUnit to make sure the redo stack does not get cleared. This allows undo units that change the UI only (cursor movements, for example) to not to interfere with the users ability to perform a redo.

The environment's implementation of IOleUndoManager looks for IOleUndoUnit and if it finds it, it calls fChangeData method to determine whether this is a UI-only undo unit fChangeData returns false). This interface can also be implemented in linked undo transaction to make the linked undo siblings ignore UI only undo actions in a linked document. For more information on linked undo transactions, see How to: Implement Linked Undo Management.

Notes to Implementers

Implement this interface if you have UI only undo items that go on the undo stack and you need to make sure the redo stack does not get reset. Implement this interface also if you have a linked undo transaction situation, where you want the siblings to ignore undo actions that involve UI only in another linked sibling.

Methods

fChangeData()

Indicates whether the undo unit applies to UI only and does not change the document data.

Applies to