All entries for Sunday 02 October 2005
October 02, 2005
Following my last post: link about the CommandProvider component I'm working on.
I decided today that having commands only available to a single form was too limited! So I enhanced the CommandCollection with a static Instance property, thus providing an AppDomain level collection of commands. In addition I added the UseGlobalCommands property to the CommandProvider. When set to true (the default) the CommandProvider's Commands property returns the CommandCollection static instance. (When false the component uses its own private CommandCollection instead.)
As a result I can have UI controls on different forms linked to the same command. In addition, a CommandProvider can be instanced in code, for example inside the static entry point of the application, and then application level commands (such as Exit) can be handled outside of any particular form.
The next job is to complete documentation of the code. I may also enhance the custom CodeDomSerializer to better format Command objects in code, so as to avoid using binary resources in the form.