开发者

How to add and show win form of different module at run time menu

I am developing a application that of several modules, Each of module developing seprately.I have to develop a integration module the call the forms of different modules.so i h开发者_运维知识库ave to decided that to develop dynamic menu from database where module and form name is stroed.How to acchieve this.plz help


CAB and SCSF does exactly this. There you have a shell that is your starting form and there you will load modules according to what the user is asking for. Modules can be loaded from the file system or some other storage.

It uses an eventing system to signal which module should load where, that way you can have multiple development teams where each is working on it's own module, they only need to decide the API.


You need an event in your Shell, which is going to have Menu. Shell will subscribe to the event which will add Menu items. Module on load shall fire an event with event arguments specifying the details about the Menu item, including its unique Tag property content to be added.

When the Menu items are clicked, fire the single event and send the tag associated with the menu item. This way individual modules can decide whether to listen and act on the event or not based on the EventArgument (which is the tag associated with the menu)

We had a fixed set of menus, the modules at run time used to dictate which menus should be enabled or disabled. Am pretty sure that you can implement dynamic menus too.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜