3

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?

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Feb 22, 2013 at 22:38

1 Answer 1

4

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(?).

answered Feb 23, 2013 at 0:30
7
  • 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? Commented Feb 23, 2013 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." Commented Feb 23, 2013 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. Commented Feb 23, 2013 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." Commented Feb 23, 2013 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. Commented Feb 25, 2013 at 2:25

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.