Select to view content in your preferred language

IExtension example in C#  - event listener?

530
2
05-11-2010 09:39 AM
VickiMartinez
Deactivated User
Can anyone point me to a good example of IExtension in C#?  I have written a simple event listener, but I don't seem to be hooking it up quite right.  I want the listener to be on whenever ArcMap is on, so no interaction from the user is required to start the tool I will be writing - well, no action other than making a feature selection with the select tool.  I am listening for the "OnSelectionChanged()" event.

I have found plenty of examples of an event listener class, so I am fairly confident in that part of my code.  The difficulty seems to be in hooking it to the application. 

Also, probably a more basic question - is this the right approach to inherit from IExtension for an event listener, or should I be inheriting from BaseTool and going at it from that direction (or something else entirely)?

Thanks very much for any input on this!
0 Kudos
2 Replies
ModyBuchbinder
Esri Regular Contributor
Hey

Check this example: http://resources.esri.com/help/9.3/ArcGISDesktop/dotnet/f90f78a3-6dcc-4a17-8e22-74c25c93eb4a.htm
It uses IExtension to wire events.

Have Fun
Mody
0 Kudos
VickiMartinez
Deactivated User
This is exactly what I was looking for.  Thanks!
0 Kudos