Click or drag to resize
CommandQueue Class
Class which is used as a command queue to store commands to execute. Supports undo/redo.
Inheritance Hierarchy
SystemObject
  SD.Tools.Algorithmia.CommandsCommandQueue

Namespace:  SD.Tools.Algorithmia.Commands
Assembly:  SD.Tools.Algorithmia (in SD.Tools.Algorithmia.dll) Version: 1.3.0.0 (1.3.17.0314)
Syntax
public class CommandQueue : IEnumerable<CommandBase>, 
	IEnumerable

The CommandQueue type exposes the following members.

Constructors
  NameDescription
Public methodCommandQueue
Initializes a new instance of the CommandQueue class.
Top
Properties
  NameDescription
Public propertyActiveCommand
Gets the active command in this queue.
Public propertyCanDo
Gets a value indicating whether this command queue can do a current command (so there's a command left to execute) (true) or false if no more commands can be executed in this queue.
Public propertyCanUndo
Gets a value indicating whether this command queue can undo the last executed command (so there are commands left to undo) (true), or false if no more commands can be undone in this queue.
Public propertyCount
Gets the number of commands in this queue
Top
Methods
  NameDescription
Public methodClear
Clears this instance.
Public methodDequeueLastExecutedCommand
Dequeues the last executed command. This is done in periods which aren't undoable.
Public methodDoCurrentCommand
Calls the current command's Do() method, if there's a command left to execute. It first makes the next command the current command and then executes it.
Public methodEnqueueCommand
Enqueues the command specified and makes it the current command.
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 methodGetEnumerator
Returns an enumerator that iterates through the collection.
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 methodRedoCurrentCommand
Calls the current command's Redo() method, if there's a command left to execute. It first makes the next command the current command and then executes it.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUndoPreviousCommand
Calls the last executed command's Undo method, if there's was a command last executed. It then makes the previous command the current command.
Top
Extension Methods
  NameDescription
Public Extension MethodSetEqualCommandBase(IEnumerableCommandBase)Overloaded.
Checks whether the enumerable to compare with is equal to the source enumerable, element wise. If elements are in a different order, the method will still return true. This is different from SequenceEqual which does take order into account
(Defined by IEnumerableExtensionMethods.)
Public Extension MethodSetEqualCommandBase(IEnumerableCommandBase, IEqualityComparerCommandBase)Overloaded.
Checks whether the enumerable to compare with is equal to the source enumerable, element wise. If elements are in a different order, the method will still return true. This is different from SequenceEqual which does take order into account
(Defined by IEnumerableExtensionMethods.)
Public Extension MethodToFilteringBindingListCommandBase
Converts the passed in enumerable to a FilteringBindingList
(Defined by ExtensionMethods.)
Public Extension MethodToHashSetCommandBase
Creates a new hashset and adds the source to it.
(Defined by IEnumerableExtensionMethods.)
Public Extension MethodToListSafeCommandBase
Converts the passed in enumerable to a List(Of T). If toEnumerate is a CommandifiedList(Of T) it will lock on its SyncRoot if it's a synchronized CommandifiedList. if it's not a commandified list, it will simply call ToList() on the enumerable. If toEnumerate is null, null is returned.
(Defined by ExtensionMethods.)
Public Extension MethodToReadOnlyCollectionTDestination
Converts the enumerable to a ReadOnlyCollection.
(Defined by IEnumerableExtensionMethods.)
Top
Explicit Interface Implementations
  NameDescription
Explicit interface implementationPrivate methodIEnumerableGetEnumerator
Returns an enumerator that iterates through a collection.
Top
Remarks
This command queue uses the policy that the current command pointer points to the command which has been executed the last time. It can only be null if it hasn't executed any commands or if the queue is empty. This policy is different from the policy where the current command pointer points to the command which is about to be executed: as the execution of a command can spawn commands, it first has to move to the command executed, and then execute it, otherwise there is a state where the current command pointer is actually the command which was executed last (as the new command to enqueue is spawned during execution of the command), because the move to the new command happens after the command has been executed in full.
See Also