Click or drag to resize

CommandQueueManager Class

Class which in in charge of managing the command queues of the application. It is used in combination of a singleton provider as there's just one instance alive in the application.
Inheritance Hierarchy
SystemObject
  SD.Tools.Algorithmia.CommandsCommandQueueManager

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 CommandQueueManager

The CommandQueueManager type exposes the following members.

Properties
  NameDescription
Public propertyRaiseEvents
Gets/ sets the RaiseEvents flag. By default, events are raised when an action is performed. To stop this from happening, call this method and pass false. This flag is for all threads.
Top
Methods
  NameDescription
Public methodActivateCommandQueueStack
Activates the command queue stack related to the stackId specified, or if there's no stack yet, it creates a new one.
Public methodBeginNonUndoablePeriod
Starts a period of command execution which aren't undoable.
Public methodBeginUndoablePeriod
Sets the command manager in a special mode where all subsequential commands are tracked inside an UndoablePeriodCommand which, when undone/redone will not destroy its command queue during undo and won't accept new commands when redone, which is useful when you want to mark a method as an undoable piece of code and the method creates objects, which can be a problem with a normal command calling the method because the objects created inside the method are re-created (so you'll get new instances) when the command is redone. If follow up commands work on the instances, redoing these commands as well causes a problem as they'll work on objects which aren't there.
Public methodCanDo
Determines whether the commandqueuestack with the id passed in can perform a Do operation (or redo)
Public methodCanUndo
Determines whether the commandqueuestack with the id passed in can perform an Undo operation
Public methodEndNonUndoablePeriod
Ends the non-undoable period started with BeginNonUndoablePeriod. Commands enqueued and ran after this method will be undoable again.
Public methodEndUndoablePeriod
Ends the undoable period started with BeginUndoablePeriod.
Public methodEnqueueAndRunCommand
Enqueues and runs the command in the top queue on the active stack. It expects there is an active command queue: if it's not one activated by the callee, it's the one belonging to this manager, which owns its own main queue.
Public methodEnqueueCommand
Enqueues the command in the top queue on the active stack. It expects there is an active command queue: if it's not one activated by the callee, it's the one belonging to this manager, which owns its own main queue.
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 methodGetActiveCommandQueueStack
Gets the command queue stack currently active in the manager for the active thread
Public methodGetCommandQueueStackForId
Gets the command queue stack related to the stackid passed in
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.)
Public methodPerformUndoablePeriod
Performs the code func inside an undoable period guarded by the command specified. Use this method if the code to run inside the undoable period is well known and can be wrapped inside a single func. The func codeToExecuteInPeriodFunc is executed once, all undo/redo logic is done by undo/redo-ing commands which were ran due to state changes caused by codeToExecuteInPeriodFunc. If you want to run a command again during redo, you should enqueue and run a normal command instead of using this method. To create an undoable period, you can also call BeginUndoablePeriod and EndUndoablePeriod.
Public methodRedoLastCommand
Redo'es the last command in the top queue.
Public methodResetActiveCommandQueue
Resets the active command queue stack. This means that the stack will get all its commands be removed and an empty queue is the result.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUndoLastCommand
Undo'es the last command in the top queue
Top
Events
  NameDescription
Public eventCommandQueueActionPerformed
Event which is raised when a command queue action has been performed. Use this event to update observer objects which track changes in the command queue manager. Raised in the same critical action block as the action itself, so the thread which started the action is also raising this event.
Top
Fields
  NameDescription
Public fieldStatic memberThrowExceptionOnDoDuringUndo
Flag to signal the CommandQueueManager and command objects whether to throw a DoDuringUndoException if a Do action is detected during an Undo action. When set to false, the Do action is ignored. Default is true. Leave to true to easily detect bugs in code which utilizes Do/Undo functionality.
Top
See Also