Export (0) Print
Expand All
0 out of 6 rated this helpful - Rate this topic

UndoEngine Class

Specifies generic undo/redo functionality at design time.

Namespace: System.ComponentModel.Design
Assembly: System.Design (in system.design.dll)

public abstract class UndoEngine : IDisposable
public abstract class UndoEngine implements IDisposable
public abstract class UndoEngine implements IDisposable
Not applicable.

The UndoEngine abstract class provides a default implementation of undo functionality at design time. An undo unit represents a single unit of undoable work. This unit is added to a stack and the user can then walk the stack to undo each action. Undo units typically are designed to toggle, which means that calling undo twice returns the application to its starting state.

The UndoEngine class takes advantage of the following characteristics of objects running within the designer:

  • All interesting objects can be persisted to some format by the designer loader.

  • All objects raise property-change notifications when a property is changed.

  • IDesignerHost offers the idea of transactions, which can be used to fabricate an undo action that spans multiple smaller actions.

With these features, UndoEngine can fabricate any undo units it needs automatically.

NoteNote:

Do not change property values directly. The UndoEngine class requires you to use the appropriate TypeDescriptor to change property values.

UndoEngine monitors for change notifications to create undo units, and the units themselves consist of serialized object states. The following table shows the services that must be available when UndoEngine is created.

Service

Description

ComponentSerializationService

Saves property and object values for a component before and after a change is made.

IComponentChangeService

Notifies the undo engine of changes made to components.

IDesignerHost

Used to track transactions.

NoteNote:

Because the UndoEngine class requires ComponentSerializationService and IComponentChangeService, it is available only at design time.

The undo engine tracks transactions and creates a single undo unit that encompasses a transaction. As a result, the undo engine has control over the duration of an undoable action. Also, because transactions can be named, undoable actions inherit their names from the current transaction. If no transaction is available and a change is reported, the undo engine creates an undo name based on the type of change (for example, "Change property 'Text'").

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

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.