Awaiting command execution using IPluginWrapper

453
2
02-14-2019 09:58 AM
DanielRouleau
New Contributor III

I have a conundrum with versioned editing when a user has finished their work and edits are outstanding. Checking the state 'esri_editing_HasEdits' is easy and sufficient for determining when there are edits, but I need to call the Save Edits button 'esri_editing_SaveEditsBtn' to prompt the user to save or discard the edits, in lieu of there being any SDK call that I have found to support interacting with the Editor.

The challenge comes in using IPluginWrapper to get an ICommand to execute, as there is no way to wait (or await) the result of the dialog that is inevitably presented to the user. This means I cannot tie any further necessary operations conditionally after the call to Save Edits, because the Execute command returns immediately before the user has had a chance to interact with the dialog.

Is there any other way to accomplish what I am attempting, or perhaps any plans to surface this sort of editing control via the SDK?

0 Kudos
2 Replies
RichRuh
Esri Regular Contributor

Hi Daniel,

This isn't an answer to the generic question about IPluginWrapper, but in this particular case, I think you are looking for the SaveEditsAsync method on ArcGIS.Desktop.Core.Project.

I hope this helps,

--Rich

DanielRouleau
New Contributor III

Thanks Rich, I had looked at all the Desktop.Editing namespaces but hadn't thought to look under the Project itself. That seems to do the trick and is easily awaitable.

0 Kudos