In NodeXL's case, .NET's standard event mechanism is used to send and receive the commands. A command is distinguished by a class derived from this RunCommandEventArgs base class. The derived class may include event information as properties when necessary. A command receiver, which implements a RunCommandEventHandler method, determines which command needs to be run by checking the derived type of the RunCommandEventArgs object that gets passed to the method.
The CommandDispatcher static class is used by senders to send commands. Receivers receive commands by subscribing to the CommandDispatcher.CommandDispatcher.CommandSent event.