I've created many custom tools in ArcMap, with most of them using the fuctionality where they are grayed out until the user starts an edit session. The code I have always used is like this:
<SPAN class="keyword token">public</SPAN> <SPAN class="keyword token">class</SPAN> <SPAN class="token class-name">ToFromTool_AddIn</SPAN> <SPAN class="punctuation token">:</SPAN> ESRI<SPAN class="punctuation token">.</SPAN>ArcGIS<SPAN class="punctuation token">.</SPAN>Desktop<SPAN class="punctuation token">.</SPAN>AddIns<SPAN class="punctuation token">.</SPAN>Button
<SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">private</SPAN> ESRI<SPAN class="punctuation token">.</SPAN>ArcGIS<SPAN class="punctuation token">.</SPAN>esriSystem<SPAN class="punctuation token">.</SPAN>UID editorUID <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">ESRI<SPAN class="punctuation token">.</SPAN>ArcGIS<SPAN class="punctuation token">.</SPAN>esriSystem<SPAN class="punctuation token">.</SPAN>UIDClass</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">private</SPAN> ESRI<SPAN class="punctuation token">.</SPAN>ArcGIS<SPAN class="punctuation token">.</SPAN>Editor<SPAN class="punctuation token">.</SPAN>IEditor3 m_editor<SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">protected</SPAN> <SPAN class="keyword token">override</SPAN> <SPAN class="keyword token">void</SPAN> <SPAN class="token function">OnUpdate</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">{</SPAN>
Enabled <SPAN class="operator token">=</SPAN> m_editor<SPAN class="punctuation token">.</SPAN>EditState <SPAN class="operator token">!=</SPAN> esriEditState<SPAN class="punctuation token">.</SPAN>esriStateNotEditing<SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>It's been a while since I've created a new ArcMap tool, but for some reason the new tool I have created will not activate when I start an edit session. There must be something I have missed, but I cannot figure it out.
Any ideas of what I need to check??