Click or drag to resize

UndoablePeriodCommand Class

Special command class which marks an Undoable Period. It doesn't perform a command itself, but marks a start and an end to other commands to be threated as a single undoable/redoable unit. It has special features: redo will re-do all contained commands and will put the CommandManager in a special state which blocks any new commands being queued during redo. Undo will not clear the queues after a queue is completely undone. The advantage of an undoable period is that it doesn't call methods to do things (like a command would) and therefore can be used to mark a method which creates new objects as an undoable period while all actions performed on datastructures inside that method are tracked in the queue of this command. An Undoable Period is to be used with undo/redo areas where new objects are created and stored in datastructures. Re-doing these kind of areas with normal commands will re-create new instances which causes problems with follow up commands if these are re-done too: those commands work on the previous objects perhaps, causing problems along te way. With an undoable period you can prevent this from happening as any method which is called through a command should be replaced with a normal method call and inside the method you should mark the code as an undoable period.
Inheritance Hierarchy
SystemObject
  SD.Tools.Algorithmia.CommandsCommandBase
    SD.Tools.Algorithmia.CommandsCommandObject
      SD.Tools.Algorithmia.CommandsUndoablePeriodCommand

Namespace:  SD.Tools.Algorithmia.Commands
Assembly:  SD.Tools.Algorithmia (in SD.Tools.Algorithmia.dll) Version: 1.4.0.0 (1.4.19.0711)
Syntax
public class UndoablePeriodCommand : Command<Object>

The UndoablePeriodCommand type exposes the following members.

Constructors
  NameDescription
Public methodUndoablePeriodCommand
Initializes a new instance of the UndoablePeriodCommand class.
Top
Properties
  NameDescription
Public propertyAfterDoAction
Gets or sets the after Do action, which is an action executed right after Do has been called on this command
(Inherited from CommandBase.)
Public propertyAfterUndoAction
Gets or sets the after Undo action, which is an action executed right after Undo has been called on this command
(Inherited from CommandBase.)
Public propertyBeforeDoAction
Gets or sets the before Do action, which is an action executed right before Do is called on this command
(Inherited from CommandBase.)
Public propertyBeforeUndoAction
Gets or sets the before Undo action, which is an action executed right before Undo is called on this command
(Inherited from CommandBase.)
Public propertyDescription
Gets or sets the description of the command. This description can be used to show the commands in a queue visually on a screen.
(Inherited from CommandBase.)
Public propertyOwnCommandQueue
Gets the own command queue of this command. This queue is then used to store commands which are spawned when this command is executed.
(Inherited from CommandBase.)
Top
Methods
  NameDescription
Protected methodDo
Executes the command.
(Overrides CommandTStateDo.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodRedo
Re-executes the command. Normally this is simply calling 'Do', however in an undoable period redo it's calling PerformRedo.
(Overrides CommandBaseRedo.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Protected methodUndo (Overrides CommandTStateUndo.)
Top
See Also