다음을 통해 공유


UndoManager Class

Helper class which wraps the Visual Studio shell's undo manager.

This API is not CLS-compliant. 

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.Modeling.Shell.UndoManager

Namespace:  Microsoft.VisualStudio.Modeling.Shell
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.Shell.12.0 (in Microsoft.VisualStudio.Modeling.Sdk.Shell.12.0.dll)

Syntax

'Declaration
<CLSCompliantAttribute(False)> _
Public Class UndoManager _
    Implements IOleCommandTarget, IVsLinkedUndoClient, IDisposable
[CLSCompliantAttribute(false)]
public class UndoManager : IOleCommandTarget, 
    IVsLinkedUndoClient, IDisposable
[CLSCompliantAttribute(false)]
public ref class UndoManager : IOleCommandTarget, 
    IVsLinkedUndoClient, IDisposable
[<CLSCompliantAttribute(false)>]
type UndoManager =  
    class 
        interface IOleCommandTarget 
        interface IVsLinkedUndoClient 
        interface IDisposable 
    end
public class UndoManager implements IOleCommandTarget, IVsLinkedUndoClient, IDisposable

The UndoManager type exposes the following members.

Constructors

  Name Description
Public method UndoManager(IServiceProvider) Create an UndoManager that wraps a new instance of IOleUndoManager.
Public method UndoManager(IServiceProvider, IOleUndoManager) Create a new UndoManager with the specified service provider and IOleUndoManager.

Top

Properties

  Name Description
Public property IsDirty
Public property VSUndoManager This is what should be pushed to the SEID for a window frame that wants to use this undo manager. We can't wrap IOleUndoManager in a managed object because the property browser QI's for MS.VS.NativeMethods.IOleCommandTarget, which is private, so we can't implement it on this class.

Top

Methods

  Name Description
Public method Add Adds an undo unit to the stack and updates the UI.
Public method DiscardUndoStacks Throws away undo/redo stacks. If the bool is true, then in addition to discarding the undostack the routine will mark the stack as clean.
Public method Dispose() Releases all resources used by the current instance of the UndoManager class.
Protected method Dispose(Boolean) Disposes the state of this object.
Public method Equals Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method Exec Implementation of IOleCommandTarget interface. Passes the call to the wrapped IOleUndoManager.
Protected method Finalize Finalizer. (Overrides Object.Finalize().)
Public method GetHashCode Serves as the default hash function. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method OnInterveningUnitBlockingLinkedUndo Indicates that the undo manager is blocking another undo manager from executing a linked action.
Public method QueryStatus Implementation of IOleCommandTarget interface. Passes call to the wrapped IOleUndoManager instance.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.VisualStudio.Modeling.Shell Namespace