GURU Quick Question

Topics: CAB & Smart Client Software Factory
May 25, 2006 at 9:39 PM
originally posted by: romzki

quick question...

how to load new toolbarmenu every time the smartpart menu changes?

May 27, 2006 at 2:28 AM
originally posted by: rschrieken

I'm not sure if I understand exactly what you want but generally you add or remove menu's etc in the Activate and Deactivate event of the workitem associated with your smartpart.

May 27, 2006 at 2:37 PM
originally posted by: askew

Use the Event Broker
May 30, 2006 at 12:58 AM
originally posted by: romzki

Yeah, how to do that? givent the following scenario:

I have a MainMenu in shell.layout
I have a Module A
I have a Module B

in module A, i have register a new ToolStripMenu item "Module A options" and i want this menu be seen only in Module A. Likewise in Module B i have create new ToolStripMenuItem an want this to show only in Module B.

My question to do this? or should i need to create a workspace for MainMenu?

May 30, 2006 at 1:50 AM
originally posted by: rschrieken

In Module A Add a WorkItem A , let WorkItem A show your view.
In WorkItem A override OnActivate, implement the menu for module a options here.
In WorekItem A override OnDeactivate, implement the removal of the menu for module a options.

Do the same for your module B stuff.

Now whenever a view that is part of the Items collection of WorkItem A becomes active, OnActivate will run amnd show your module A menu.
When a view from Module B is shown, The Deactivate event of WorkItem will run (thus removing your module a options menu) and the run the OnActivate of the WorkItem B. That will add your Module B options again.

And the calling of all this is being done with the Eventbroker, or just .Net Events (in case you don't need to be that decoupled)

Hope this clarifies matters.

May 30, 2006 at 1:58 AM
originally posted by: GregShaw

May 30, 2006 at 2:03 AM
originally posted by: romzki

Thanks so much Rene - i understand completely.

Hope this not bother you so much.