In my module code, I attempt to stop users from deleting more than one feature at a time using this logic, which has always worked
<SPAN class="keyword token">protected</SPAN> <SPAN class="keyword token">async</SPAN> <SPAN class="keyword token">static</SPAN> <SPAN class="keyword token">void</SPAN> <SPAN class="token function">OnRowDeleteEvent</SPAN><SPAN class="punctuation token">(</SPAN>RowChangedEventArgs args<SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">try</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="comment token">// get the currently selected features in the map</SPAN>
<SPAN class="keyword token">int</SPAN> selectedCount <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">await</SPAN> FeatureServiceManagement<SPAN class="punctuation token">.</SPAN><SPAN class="token function">GetMapSelectionCount</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">int</SPAN> selectedFeatureCount <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">await</SPAN> FeatureServiceManagement<SPAN class="punctuation token">.</SPAN><SPAN class="token function">GetMapFeatureSelectionCount</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>selectedCount <SPAN class="operator token">></SPAN> <SPAN class="number token">1</SPAN> <SPAN class="operator token">||</SPAN> selectedFeatureCount <SPAN class="operator token">></SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="comment token">//CANCEL the Delete</SPAN>
args<SPAN class="punctuation token">.</SPAN><SPAN class="token function">CancelEdit</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">=</SPAN><SPAN class="operator token">></SPAN> <SPAN class="token function">DeleteMultipleError</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">return</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<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></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>However, I need to allow a user to use the MERGE functionality/tool from the modify features toolset. the merge tool requires one or more of the selected features to be deleted, the problem is that my code above prevents that deletion (as 2 features are selected). I want to determine if the merge tool has been clicked and by pass my logic if that tool has been initiated. However whenever I call FrameworkApplication.ActiveTool it just returns the Select tool that I previously had selected, not the tool I clicked in the Modify Features window. How do I get the name of the Modify features tool selected from my Module code.
