The CAB extensions support using the UltraWinToolBar as extension sites. The ToolbarsManagerFactory supports UltraToolBars and the ToolsCollectionUIAdapter supports PopupMenuTools. Is there any examples of placing a UltraWinToolBarManager on a form with one ToolBar and then using registering UIElementSites to manipulate it in code?
It appears that the sites don't include the manager but you need to add tools to it's collection before you can add them to the popupmenu. How would you structure this in your application so that CAB modules dynamically loaded can add or manipulate toolbars and popupmenus?
Hello,
I am just checking about the progress of this issue. Let me know If you need my further assistance on this issue?
Thank you for using Infragistics Components.
the UltraToolbar UIExtensionSite can only work with ButtonTools.
If you want to work with toolbars and popupmenus you have two options:
1. Modify Infragistics.CompositeUI.WinForms in a way that you can add a toolbar and a popupmenu in UIExtensionSite style.
2. Add the ToolbarsManager reference to the Items collection of the RootWorkItem (say "MainToolbarsManager"), which will be available to you in any module. Just cast WorkItem.RootWorkItem.Items['MainToolbarsManager"] to UltraToolbarsManager and you can programatically add toolbars and popupmenus to it.
HTH,
Emanuel
Hello ,
If you want to dynamically manipulate a module when you are using CAB, you should use Dependency injection or Inversion of Control.
Dependency injection as a general concept is explained better by Martin Fowler at http://www.martinfowler.com/articles/injection.html . However, in short it is a means of allowing a main class to use a second, dependent class without directly referencing that class. Some external entity will provide the second class to the main class at runtime – it will ‘inject’ the ‘dependency’. Obviously to be useful the second class will need to implement an interface that the main class knows about.
http://richnewman.wordpress.com/dependency-injection-example-setter-injection/
The conventional definition of inversion of control relates to frameworks and code re-use. Normally to re-use someone else’s code you would call into a library. You do this all the time in the .NET framework. For example, if you call Math.Tan() you are using someone else’s code, but you make the call and you have control.
However, there are times using .NET when the framework calls you back. An example is when you write a custom array sort algorithm using the IComparable or IComparer interfaces. Another is when you implement a custom enumerator by implementing IEnumerable on a collection class. In these cases the usual direction of control is inverted: something else is calling your code, rather than you calling something else.
http://martinfowler.com/bliki/InversionOfControl.html
I hope this helps.