Select to view content in your preferred language

Manually using the Editor class

693
3
10-27-2010 09:49 AM
IdoFlatow
Emerging Contributor
I would like to build my own control for enabling and stoping editing.

using the Editing.EditVertice.Execute I managed to start the edit process and also managed to sent it the garphic item to edit.

Now I want to implement the stop edit, but it seems there's no manual way to stop editing, because the editing object does not expose any StopEdit method, nor does the map.

How can I manually stop editing?
0 Kudos
3 Replies
IdoFlatow
Emerging Contributor
I managed to call the editor's ClearActiveAction method in reflection (it's a private method) and it seems to stop the editing.

Is this the correct technique? will this method become public at some point so we can manually decide when to start and when to end the edit? (for cases when the developer is required to allow editing using non-standard ways, such as "press F2 for edit and F4 to stop editing"
0 Kudos
JenniferNery
Esri Regular Contributor
Please look at this sample:
http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#EditToolsAutoSave

CancelActive is the command you use to cancel the current active command.

Clicking the "Clear Action" button with Command Binding to Editor's CancelActive is equivalent to this in code-behind:

if(editor.CancelActive.CanExecute(null))
  editor.CancelActive.Execute(null);

where editor is your Editor instance, null is the CommandParameter.
0 Kudos
IdoFlatow
Emerging Contributor
Please look at this sample:
http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#EditToolsAutoSave

CancelActive is the command you use to cancel the current active command.

Clicking the "Clear Action" button with Command Binding to Editor's CancelActive is equivalent to this in code-behind:

if(editor.CancelActive.CanExecute(null))
  editor.CancelActive.Execute(null);

where editor is your Editor instance, null is the CommandParameter.


Missed that one, thanks.
0 Kudos