AnsweredAssumed Answered

Detecting which Modify Operation is running

Question asked by mjk5000 on Nov 28, 2018
Latest reply on Jun 11, 2019 by sean_jones-esristaff

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

protected async static void OnRowDeleteEvent(RowChangedEventArgs args)
                // get the currently selected features in the map
                int selectedCount = await FeatureServiceManagement.GetMapSelectionCount();
                int selectedFeatureCount = await FeatureServiceManagement.GetMapFeatureSelectionCount();
                if (selectedCount > 1 || selectedFeatureCount > 1)
                    //CANCEL the Delete
                    args.CancelEdit(() => DeleteMultipleError());


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.