ikeough/Dynamo — pull request #564 by Benglin (2013-10-14 17:31:16+00:00)
Title: Command framework initial submission

#### Background

* "DynamoController.MakeSandbox" method now takes in a command file path. The following is the way DynamoSandbox.exe is run with a pre-recorded command XML file:

C:\bin>DynamoSandbox.exe /c "C:\file\path\command-file.xml"

* In a stand-alone mode (without command file argument), selected user actions are recorded in a "command queue". CTRL+SHIFT+R key combination writes out all the recorded commands (in command queue) into an external XML file and opens it up in the default XML viewer program.

* "DynamoViewModel" is in-charge of command channeling, recording and playback. As described in the design document, "DynamoViewModel.ExecuteCommand" method is the entry point for all recordable commands.

* As of today, the following commands can be recorded/playback. More commands will be made recordable and submitted in subsequent submissions, but this pull request marks the first logical conclusion of command framework infrastructure that can be meaningfully merged with the master.

* Node/note creations
* Node selection (cross selection, contain selection, click selection)
* Node dragging
* Connection creation

* "DynamoModel.CreateNode_Internal" method has been replaced by "DynamoModel.CreateNode" method that takes in strongly typed parameters (instead of a dictionary of string-object pairs). This changes quite a number of unit test cases that create nodes as part of their test flow. Several overloaded "CreateNode" methods are also introduced for specific requirements of the caller (they get redirected to the private method "CreateNodeInternal" eventually).

* "RecordableCommand" and all its derived classes are made nested classes of "DynamoViewModel" because they need to access some private methods of "DynamoViewModel" which should not be exposed to external codes.

* The notion of an "active connector" and "dragged nodes" are now moved out of the StateMachine into DynamoViewModel, leaving the StateMachine managing only the states and issuing various recordable commands.

#### Demonstration

[Click here for a video demo of the command framework](https://docs.google.com/a/adsk-oss.com/file/d/0B_DOI50Z4eklSW9xQlRtRnBSOUE/edit)

#### Testing scenarios

* Node and Note creations should be successful
* Node dragging should be as expected (with zoom/scale factored in)
* Node selections (cross/contain/click selection) should be as expected
* Connections can be created, removed, and replaced
* All the above should properly support undo/redo actions