OleUndoEngine Class

Provides a default implementation of undo management for designers.

Inheritance Hierarchy

System.Object
  System.ComponentModel.Design.UndoEngine
    Microsoft.VisualStudio.Shell.Design.OleUndoEngine

Namespace:  Microsoft.VisualStudio.Shell.Design
Assembly:  Microsoft.VisualStudio.Shell.Design (in Microsoft.VisualStudio.Shell.Design.dll)

Syntax

'Declaration
Public Class OleUndoEngine _
    Inherits UndoEngine _
    Implements IVsLinkedUndoClient
public class OleUndoEngine : UndoEngine, 
    IVsLinkedUndoClient
public ref class OleUndoEngine : public UndoEngine, 
    IVsLinkedUndoClient
type OleUndoEngine =  
    class 
        inherit UndoEngine 
        interface IVsLinkedUndoClient 
    end
public class OleUndoEngine extends UndoEngine implements IVsLinkedUndoClient

The OleUndoEngine type exposes the following members.

Constructors

  Name Description
Public method OleUndoEngine Initializes a new instance of OleUndoEngine.

Top

Properties

  Name Description
Public property Enabled Enables or disables the UndoEngine. (Inherited from UndoEngine.)
Public property UndoInProgress Indicates if an undo action is in progress. (Inherited from UndoEngine.)

Top

Methods

  Name Description
Protected method AddUndoUnit Adds the undo unit to the undo unit manager. (Overrides UndoEngine.AddUndoUnit(UndoEngine.UndoUnit).)
Protected method CreateUndoUnit Creates a new undo unit. (Overrides UndoEngine.CreateUndoUnit(String, Boolean).)
Protected method DiscardUndoUnit Closes this unit if it is a parent undo unit. (Overrides UndoEngine.DiscardUndoUnit(UndoEngine.UndoUnit).)
Public method Dispose() Releases all resources used by the UndoEngine. (Inherited from UndoEngine.)
Protected method Dispose(Boolean) Disposes the resources of this object. (Overrides UndoEngine.Dispose(Boolean).)
Public method Equals Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Protected method GetRequiredService Gets the requested service. (Inherited from UndoEngine.)
Protected method GetService Gets the requested service. (Inherited from UndoEngine.)
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.)
Protected method OnUndoing Raises the Undoing event. (Inherited from UndoEngine.)
Protected method OnUndone Raises the Undone event. (Inherited from UndoEngine.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Events

  Name Description
Public event Undoing Occurs immediately before an undo action is performed. (Inherited from UndoEngine.)
Public event Undone Occurs immediately after an undo action is performed. (Inherited from UndoEngine.)

Top

Explicit Interface Implementations

  Name Description
Explicit interface implemetationPrivate method IVsLinkedUndoClient.OnInterveningUnitBlockingLinkedUndo Indicates that the undo manager is blocking another undo manager from executing a linked action.

Top

Remarks

The OleUndoEngine class provides a default implementation of the UndoEngine and IVsLinkedUndoClient interfaces used to manage undo operations, which allow users to reverse their recent changes when modifying a code element.

Note

Typically, designers implemented under Visual Studio and .NET Framework are based on Control and have undo support automatically provided by the environment.

Designers will need to implement their own undo management if either:

  • The designer uses a graphical user interface, referred to as a ViewAdapter, other than that supplied by Control.

    This will require the registry of the ViewAdapter with Visual Studio using ProvideViewAdapterAttribute.

    An example of this might be creating a product with a web-based graphical design interface rather than a .NET Framework based graphical interface.

  • The designers do not use the Visual Studio code generation model provided in the System.CodeDom name space.

The OleUndoEngine class transparently supports child undo units, as it uses custom undo units (atomic sections of code which can be removed in an undo operation) UndoEngine.UndoUnit, which fully implement IOleUndoUnit and IOleParentUndoUnit.

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.Shell.Design Namespace

UndoEngine.UndoUnit

OleUndoEngine

OnInterveningUnitBlockingLinkedUndo

OleUndoEngine

AddUndoUnit

CreateUndoUnit

DiscardUndoUnit

Dispose

Other Resources

Supplying Undo Support to Designers