Version

Methods and Properties Reference for Creating Custom UndoUnit

Topic Overview

Purpose

This topic lists the available methods and properties related to creating of a custom UndoUnit in the Infragistics Undo/Redo Framework™.

Required background

The following table lists the topics required as a prerequisite to understanding this topic.

Topic Purpose

This topic lists the derived classes and some of the important properties and methods of the UndoUnit class.

Methods and Properties Reference for Creating Custom UndoUnit

Introduction

The UndoUnit is an abstract base class that is used to undo/redo changes.

If you need to support undo/redo of specific type of changes, you need to create a custom UndoUnit. The class exposes several abstract members listed below.

Methods and Properties Reference for Creating Custom UndoUnit 1.png

Methods reference summary

The following table summarizes the purpose and functionality of the methods exposed by the UndoUnit class.

Method Description

Execute

Used to perform the undo/redo operation for the change.

The method takes UndoExecuteContext object as a parameter. This parameter provides information about:

  • the type of operation being performed (for example - Undo, Redo, Rollback)

  • The reference to the UndoManager for which the operation is being performed.

Note
Note:

During an Undo/Redo operation, the object will be removed from the Undo/Redo stack and will not automatically be put onto the alternate stack.

It is assumed that the changes made by the UndoUnit will result in operations being added to the undo/redo stack by invoking the AddChange method (directly or indirectly via helper methods).

If the object being manipulated is not responsible for doing this, the custom UndoUnit could handle this itself.

Returns a string description of the type of change.

The method takes two parameters:

  • an UndoHistoryItemType – to indicate from which history a description is required

  • a boolean value to specify if a detailed description is needed.

Merge

Used to provide custom support for merging UndoUnit``s.

Properties reference summary

The following table summarizes the purpose and functionality of the properties exposed by the UndoUnit class.

Property Description

Identifies the object that will be affected by the UndoUnit.

This is a read-only property used mainly for informational purposes when the methods ForEach or RemoveAll are used.

Related Content

Topics

The following topics provide additional information related to this topic.

Topic Purpose

This topic lists the available methods for adding an UndoUnit derived class object to the undo history.

This topic lists the available methods for removing the UndoUnit instances from the undo/redo history.

This topic lists the methods that register/unregister a specific object to an UndoManager instance.

This topic lists the available methods for performing undo and redo operations.

This topic lists the available methods and properties for performing undo/redo transactions.

This topic lists the available methods and properties related to the merging of undo/redo operations.

This topic lists the available commands in the Infragistics Undo/Redo Framework™.

This topic lists the available methods for suspending and resuming the saving of the undo/redo operations in history.