kaspatoo

Identify ID of clicked Add-In Button

Discussion created by kaspatoo on Apr 1, 2011
Latest reply on Apr 6, 2011 by kaspatoo
Hello,

I created a toolbar with a collection of buttons as Add-Ins with c#. In the Config.esriaddinx (xml-document) I have to define the buttons and the aiming classes of each button.
I have also created a utility-class where all my mehtods are stored (going to use MVC). Thats Why I have no many classes, offering a onClick an a onUpdate Method but all doing the same, calling the demanded functions.
To have a really MVC I thought of using just on class for all my buttons as controll-class. A click on each button executes the same onClick method in my controll-class. Within this function I want to identify the button which is clicked, maybe through its ID, assigned in the xml.
Then a select case or anything else will invoke the correct code stored in my util class.

The benefits are to make use of mvc and having one instead of 10 classes.

So if not already recognized, my question is:

How can I identify the ID or anything else of the Add-In Button which I Clicked in ArcMap, within the onClick Method?

If you have any more questions, feel free to ask, I will help you to elp me.
Thanks.

Outcomes