Condividi tramite


UndoManager Class

Definition

Important

This API is not CLS-compliant.

Helper class which wraps the VS shell's undo manager.

public ref class UndoManager : IDisposable, Microsoft::VisualStudio::OLE::Interop::IOleCommandTarget, Microsoft::VisualStudio::TextManager::Interop::IVsLinkedUndoClient
[System.CLSCompliant(false)]
public class UndoManager : IDisposable, Microsoft.VisualStudio.OLE.Interop.IOleCommandTarget, Microsoft.VisualStudio.TextManager.Interop.IVsLinkedUndoClient
public class UndoManager : IDisposable, Microsoft.VisualStudio.OLE.Interop.IOleCommandTarget, Microsoft.VisualStudio.TextManager.Interop.IVsLinkedUndoClient
[<System.CLSCompliant(false)>]
type UndoManager = class
    interface IOleCommandTarget
    interface IVsLinkedUndoClient
    interface IDisposable
type UndoManager = class
    interface IOleCommandTarget
    interface IVsLinkedUndoClient
    interface IDisposable
Public Class UndoManager
Implements IDisposable, IOleCommandTarget, IVsLinkedUndoClient
Inheritance
UndoManager
Attributes
Implements

Constructors

UndoManager(IServiceProvider, IOleUndoManager)

Create a new UndoManager with the specified service provider and OLEUndoManager. If the specified OLEUndoManager is null, then a new OLEUndoManager is created and sited with the service provider. If on the other hand an OLEUndoManager is passed in it is assumed that it has already been sited with a service provider. It is required that the supplied undo manager implement IOleCommandTarget. It is expected that it implement IVsLinkCapableUndoManager, if not then linked undo will not be available.

UndoManager(IServiceProvider)

Create a new UndoManager. This CoCreates the shell's undo manager.

Properties

IsDirty
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.

Methods

Add(IOleUndoUnit)

Adds an undo unit to the stack and updates the UI.

DiscardUndoStacks(Boolean)

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.

Dispose()

Cleans up resources allocated by the doc data. Allows us to pre-empt the GC.

Dispose(Boolean)

Disposes the state of this object.

Exec(Guid, UInt32, UInt32, IntPtr, IntPtr)

Implementation of IOleCommandTarget interface. Passes call through to undoCommandTarget.

Finalize()

Finalizer.

OnInterveningUnitBlockingLinkedUndo()

This is called in the case that there is a strictly linked undo across multiple documents, and the user wants to undo past the point of the linked undo. The intent is that the designer will put up some UI informing the user of this. It turns out that currently you have to implement this if you ever want your undo manager to participate in linked undo, whether or not you use strict linking. We just return E_FAIL, which directs the shell to put up the default UI.

QueryStatus(Guid, UInt32, OLECMD[], IntPtr)

Implementation of IOleCommandTarget interface. Passes call through to undoCommandTarget.

Applies to