OleUndoEngine Class
Provides a default implementation of undo management for designers.
Inheritance Hierarchy
Object
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 | |
---|---|---|
OleUndoEngine | Initializes a new instance of OleUndoEngine. |
Top
Properties
Name | Description | |
---|---|---|
Enabled | Enables or disables the UndoEngine. (Inherited from UndoEngine.) | |
UndoInProgress | Indicates if an undo action is in progress. (Inherited from UndoEngine.) |
Top
Methods
Name | Description | |
---|---|---|
AddUndoUnit | Adds the undo unit to the undo unit manager. (Overrides UndoEngine.AddUndoUnit(UndoUnit).) | |
CreateUndoUnit | Creates a new undo unit. (Overrides UndoEngine.CreateUndoUnit(String, Boolean).) | |
DiscardUndoUnit | Closes this unit if it is a parent undo unit. (Overrides UndoEngine.DiscardUndoUnit(UndoUnit).) | |
Dispose | Releases all resources used by the UndoEngine. (Inherited from UndoEngine.) | |
Dispose(Boolean) | Disposes the resources of this object. (Overrides UndoEngine.Dispose(Boolean).) | |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetRequiredService | Gets the requested service. (Inherited from UndoEngine.) | |
GetService | Gets the requested service. (Inherited from UndoEngine.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
OnUndoing | Raises the Undoing event. (Inherited from UndoEngine.) | |
OnUndone | Raises the Undone event. (Inherited from UndoEngine.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Top
Events
Name | Description | |
---|---|---|
Undoing | Occurs immediately before an undo action is performed. (Inherited from UndoEngine.) | |
Undone | Occurs immediately after an undo action is performed. (Inherited from UndoEngine.) |
Top
Explicit Interface Implementations
Name | Description | |
---|---|---|
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) 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
OleUndoEngine
OnInterveningUnitBlockingLinkedUndo