5

Is there a way to enable / disable Add-In buttons / tools?

asked Nov 17, 2010 at 19:59

2 Answers 2

2

According to the documentation this can be done in the OnUpdate method, Add-in coding patterns

answered Nov 17, 2010 at 21:57
2
  • Perfect. Thanks. Just curious, if the OnUpdate method is likely checked often, how much impact does a code placed there have on performance? Suppose I am checking the state of the editor and enable/disable commands based on it. Where is the best place to declare the editor? If Editor is used throughout the Add-In, should I declare it once globally say in a module? Commented Nov 18, 2010 at 13:58
  • @Jakub, the documentation states "Particularly time consuming operations, such as database queries, should never be performed within OnUpdate." So if you do checks of properties of objects in memory I don't think you will get in any problems. Commented Nov 18, 2010 at 15:30
0

I got that wrong the first time . Not sure why I was thinking checked when you said enabled.

But enabled is boolean just like checked: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/Enabled_Property/001v000000s0000000/

http://www.google.com/codesearch/p?hl=en#585OjyuBOxM/trunk/Umbriel.ArcMap.Addin/ShowSelectByLocation/ShowSelectByLocationButton.cs&q=Enabled%20package:http://umbriel%5C.googlecode%5C.com&l=70

(削除) Checked property.

For example, check out line #51 :[http://code.google.com/p/umbriel/source/browse/trunk/Umbriel.ArcMap.Addin/Umbriel.ArcMap.Addin.EditorTrack/EditorTrackToggleButton.cs#51][1]

[1]: http://code.google.com/p/umbriel/source/browse/trunk/Umbriel.ArcMap.Addin/Umbriel.ArcMap.Addin.EditorTrack/EditorTrackToggleButton.cs#51 (削除ここまで)

answered Nov 17, 2010 at 21:48

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.