ArcMap add-in initialization

156
4
10-19-2019 02:46 AM
Highlighted
Occasional Contributor II

I'm developing add-in using ArcObjects for .NET for ArcMap. Where can I place code on add-in startup and shutdown? Right now I'm using extension within add-in for that purpose. But I want to get rid of extension. Is it possible?

Tags (2)
Reply
0 Kudos
4 Replies
Highlighted
MVP Frequent Contributor

What sort of AddIn are you creating? A button, a toolbar with buttons, a panel...?

Reply
0 Kudos
Highlighted
Occasional Contributor II

Toolbar with buttons. But it doesn't matter. I need to do some actions when add-in starts and finishes. And I want to do these actions without extension.

Reply
0 Kudos
Highlighted
MVP Frequent Contributor

Have you seen this page, they are wiring up application events within an addin.

In the past I've set the onDemand property to False for a button which forces the addin button to load and you can run code in the onstartup() but this does not deal with shutdown.

Reply
0 Kudos
Highlighted
Occasional Contributor II

I think using application events is wrong way. I need exactly points in time where add-in initialized and uninitialized. I can use extension for that purpose. But it's complexity without any benefits for user (user should remember that turning extension on in Extension dialog is required to use add-in).

Reply
0 Kudos