Do Infragistics managers support versioning? UltraToolbarsManager, UltraDockManager, and UltraTabbedMdiManager.
For example, if we save the settings of v7.1, can we load then into v7.3?Thanks.
Yes this is supported. The settings available in the new version which did not exist when the settings file was saved will be initialized with their default values.
That's cool, thanks!
I have a related question about versioning of my own GUI components.
For example, I have one Toolbar_1 in my v1 app, and i added a second Toolbar_2 in my v2 app. Let's not worry about the Infragistics version for the moment, say both are using v7.3. However, i would like to my v2 app to read the Toolbar settings saved in my v1 app.How can I achieve that? I think it is related to how infragistics implement versioning for their components, i.e, when they do serialize or deserialzie, some of the sub-components must be optional.
This is actually expected behavior. Loading the layout file completely clears all preexisting tools, toolbars, ribbon tabs and group as well as settings on the toolbars manager and recreates them. The load operation ignores the fact that the contents of the toolbars manager has changed since the layout file was created. What you are looking for is a way to merge a preexisting layout file with the current layout of the manager such that new tools not in the layout file remain where they are and old tools which no longer exist in the manager are not recreated. You can submit a feature request for this here: http://devcenter.infragistics.com/Protected/RequestFeature.aspx.
A similar problem when the new version removes a tool from the GUI.
For example, version 1 has 10 tools, version 2 removed one and left 9 tools.
When v2 app loads the layout settings file in v1, it created 10 tools instead of 9.
I guess it is the same bug from Infragistics.I actually founda workaround for that:after loading the layout, check if the old tool is in the ToolbarManager, and remove it if it is.
It is not a very nice solution.
Thanks.
I believe the tool keeps a reference to its toolbars manager which is checked in the Add method. It's possible this reference is not cleared when the tool is removed after loading a layout. This could be a bug. You can report it to the support group here: http://es.infragistics.com/gethelp.
As a workaround, you will have to recreate the tool and set all properties back on it and add that tool to the collection.
I tried what you suggested in a sample app, and I got some exception when add the new tool to the collection.Here is what I did in the mainform's OnLoad method:
{
// here the tools collection has 7 tools including the new tool
LoadToolbarLayout("Toolbar.xml"); // load the old layout file with 6 tools
// here it has 6 tools, the new tool is not in the collection
if (!ultraToolbarsManager1.Tools.Contains(newTool)) ultraToolbarsManager1.Tools.Add(newTool); // this line throws an exception below
}
Exception: Can't add tool to the ToolbarsManager Tools collection - tool is already a member of the ToolbarsManager Tools collection."
Have you got any idea what's wrong?
Thanks!
If you load a layout file saved with your old version, it will remove any new tools or toolbars which were added in your new version. You can either load the old layout file then check to see if the new toolbar is gone, and if so, re-add it and all its tools, or you can not load in the old layout file. You can submit a feature request for layout file merging, which will allow you to load in a layout file such that it doesn't affect any new tools or toolbars added after the layout file was saved: http://devcenter.infragistics.com/Protected/RequestFeature.aspx.