UndoCollection Class |
The UndoCollection class is used to manage operations that need undo/redo functinality. The collection contains properties to specify the number of allowed operations to undo or redo.
Namespace: Atalasoft.Imaging
The UndoCollection type exposes the following members.
Name | Description | |
---|---|---|
Count | The number of items in the collection. (Inherited from MarshalByRefReadOnlyCollectionBase.) | |
InnerList | Gets the ArrayList stored within the collection. (Inherited from MarshalByRefReadOnlyCollectionBase.) | |
IsSynchronized | Gets a value indicating whether access to the collection is synchronized (thread-safe). | |
Item | Gets the undo item. | |
Levels | Gets or set the number of Undo levels in this collection. | |
NumRedos | Gets the current number of redos in the collection. | |
NumUndos | Gets the current number of undos in the collection. | |
SyncRoot | Gets an object that can be used to synchronize access to the collection. |
Name | Description | |
---|---|---|
Add | Add a new undo level to the undo collection specifying the description and if the Image is copied. | |
Clear | Clears the undo/redo collection items. | |
CopyTo(Array, Int32) | Copies the collection items into an array. (Inherited from MarshalByRefReadOnlyCollectionBase.) | |
CopyTo(UndoLevel, Int32) | Copies the UndoLevels into an array. | |
CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.) | |
Dispose | Clean up unmanaged resources by disposing each AtalaImage in the collection. | |
Dispose(Boolean) |
Releases unmanaged and - optionally - managed resources.
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize |
Finalizes an instance of the UndoCollection class.
(Overrides ObjectFinalize.) | |
GetEnumerator | Returns a reference to an IEnumerator interface, whose purpose is to grant access to an
enumeration's items. (Inherited from MarshalByRefReadOnlyCollectionBase.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
MemberwiseClone(Boolean) | Creates a shallow copy of the current MarshalByRefObject object. (Inherited from MarshalByRefObject.) | |
OnGetCurrentImageCollection |
Raises the [E:GetCurrentImageCollection] event.
| |
OnNewImageCollection |
Raises the [E:NewImageCollection] event.
| |
Redo | The Redo method redo's the most recent udno in this UndoCollection.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
Undo | The Undo method undo's the most recently added item to this
UndoCollection. |
NOTE: The UndoCollection class is intended for use in the Workspace class only, and should not be used on its own. The UndoCollection relies on the Workspace'sImageCollection in order to save the current images.
The undo collection may be used to create an Undo/Redo menu in your project. The Add method should be called at the point you want to save as the 'undo point' (for examble, BEFORE an ImageCommand is applied). To undo or redo an operation, simply call the Undo or Redo methods. You can access the Description property to determine what the next undo or redo will accomplish. The following code example shows how this is done.
Accessing the description of the next operation to undo/redo.
WorkspaceViewer Viewer; ... string undoDescription = Viewer.Undos[Viewer.Undos.Count - Viewer.Undos.NumUndos].Description; string redoDescription = Viewer.Undos[Viewer.Undos.Count - Viewer.Undos.NumUndos - 1].Description;
Dim Viewer As WorkspaceViewer ... Dim undoDescription As String = Viewer.Undos(Viewer.Undos.Count - Viewer.Undos.NumUndos).Description Dim redoDescription As String = Viewer.Undos(Viewer.Undos.Count - Viewer.Undos.NumUndos - 1).Description