Select to view content in your preferred language

Extension state not being updated

421
1
09-19-2011 08:24 AM
FaizanTayyab
Deactivated User
Hi All,

I have the code below in an Addin extension.


            IExtensionManager pExtMgr;
            IExtension pExt;
            IExtensionConfig pExtCfg;

            pExtMgr = ArcMap.Application as IExtensionManager;
            if (pExtMgr != null)
            {
                for (int i = 0; i < pExtMgr.ExtensionCount - 1; i++)
                {
                    pExt = pExtMgr.Extension;
                    if (pExt is IExtensionConfig)
                    {
                        pExtCfg = pExt as IExtensionConfig;

                        if (pExtCfg.ProductName == "Extension A" ||
                            pExtCfg.ProductName == "Extension B" ||
                            pExtCfg.ProductName == "Extension C")
                        {
                            pExtCfg.State = esriExtensionState.esriESEnabled;
                        }
                    }
                }
            }



I have checked the code and for the three Extensions list, the if condition is true and the command for setting the state to enable runs but for some reason, they are not enabled.

This code has been placed in the OnStartup() in an Addin extension.

Anyone have any ideas as to why the enabled state is applied or updated.

Thanks
0 Kudos
1 Reply
SandyReuther
Occasional Contributor
Hey Feizan,

did you find a solution to your problem or hear anything from ESRI about your question? I have a similar problem:

http://forums.arcgis.com/threads/52088-AcrMap-Application-Extension-AddIn-and-IExtensionConfig?p=177...

No idea at all...

Many greetings
Sandy
0 Kudos