Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

We are using custom layers in our plugin used in ArcScene/ArcMap. For quite some time we were trying to figure out how to hook into the event occuring when the user selects "Refresh" in the right click menu item of a layer in the TOC.

Any advice how to do that?

Thanks.

share|improve this question
add comment

1 Answer

I'm not sure about this particular command, but in general, you can intercept these sorts of things by implementing ICustomizationFilter and capturing what gets called when esriCEInvokeCommand is passed to OnCustomizeEvent. Implement the interface and register the class via IApplication.LockCustomization. Returning false for this method results in it being blocked, as I recall(?).

share|improve this answer
    
Thanks for the hint. The ICustomizationFilter documentation (help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/…) says "There can only be one active customization filter in a running application.". What happens if we encounter an active application filter? –  Bengt Feb 23 '13 at 2:29
    
"You should only use customization filters in locked down applications where you have complete control of the application setup and how the users interact with that application." –  blah238 Feb 23 '13 at 3:08
    
@Bengt That's something worth watching out for. If you need to play nicely with others tools that have already locked customization, this probably is not the right approach. I think there are very few extensions/add-ins that lock customization though. I could be wrong though ... this might be a good question - "What are some arcgis app extensions that lock customization?". I don't see a Refresh option on my context menu in Arcmap. You might also consider IActiveViewEvents.Refreshed if that is what Refresh does, I assume ArcScene has an equivalent. –  Kirk Kuykendall Feb 23 '13 at 4:09
    
@blah238 I think that's a bit misleading - you could implement a customization filter that does absolutely nothing (other than interfere with some other customization filter). I think this phrasing would be more appropriate: "You should <del>only</del> use customization filters in locked down applications where you need to have complete control of the application setup and how the users interact with that application." –  Kirk Kuykendall Feb 23 '13 at 4:15
    
@Kirk Kuykendall When you right-click a graphics layer in the TOC in ArcScene (dunno exactly about ArcMap), there's a Refresh option. We tried many different events, nothing is raised when the user selects that command. IActiveViewEvents.ViewRefreshed is called VERY often, by other things too, and it doesn't seem we have a way to determine whether it was called because of the Refresh command. –  Bengt Feb 25 '13 at 2:25
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.