I developed an extension with ArcGIS 10.4.1 that I can use through the extension menu and now I need it as a toolbar. The problem is that ArcGIS launches only the startup() event from the extension and not my newly added BaseToolBar.startup()
/// <summary>
/// Classe d'extension pour le contexte
/// </summary>
[Guid("4600d1fb-cac2-4f6d-a726-261abe40dfad")]
[ClassInterface(ClassInterfaceType.None)]
[ProgId("Mrn.Taktik.ControleGis.ContexteExtension")]
public class ContexteExtension : IExtension, IExtensionConfig, IPersistVariant
{
. . . Parameters and Access variables . . .
public void Startup(ref object initializationData)
{
this.application = initializationData as IApplication;
this.appStatus = this.application as IApplicationStatus;
if (this.application != null)
{
contexteTakTik = ContexteTakTik.Instance;
contexteTakTik.Initialiser(new IntPtr(this.application.hWnd));
//// Wireup the events
this.SetupEvents();
}
}
. . . #region COM Registration Functions . . .
}
At this point, I simply created a BaseToolbar and copied what was inside my class into the new one. The only way to to amke it work right now is if I keep included the extension class as it is the only way for my code to enter Startup(). I tried to look online where it is first called but couldnt find anything. I need my code to go through BarreOutils.Startup() and not ContexteExtension.Startup().
/// <summary>
/// Description for ArcGISToolbar1.
/// </summary>
[Guid("bfeb9989-0c45-4db4-b12d-310efaa5d787")]
[ClassInterface(ClassInterfaceType.None)]
[ProgId("Mrn.Taktik.ControleGis.ArcGISToolbar1")]
public sealed class BarreOutils : BaseToolbar
{
. . . Parameters and Access variables . . .
public void Startup(ref object initializationData)
{
this.application = initializationData as IApplication;
this.appStatus = this.application as IApplicationStatus;
if (this.application != null)
{
contexteTakTik = ContexteTakTik.Instance;
contexteTakTik.Initialiser(new IntPtr(this.application.hWnd));
//// Wireup the events
this.SetupEvents();
}
}
. . . #region COM Registration Functions . . .
}