Hi Jennifer,
iìve tried your code: maybe i wasn't able to explain u my request.
Let me try to explain u better:
What i want to do is NOT the delete selected polygon , simple the deselect the polygon selected.
I try to write u the steps :
1) Put 2 feature layers ( L1 and L2 ) on map. (i have set the editor by code).
2) Press a button to start selection session:
private void Button_Click(object sender, RoutedEventArgs e)
{
_editor = new Editor();
_editor.Map = MyMap;
_editor.SelectionMode = DrawMode.Point;
_editor.Select.Execute("New");
_editor.ContinuousMode = true;
_editor.EditCompleted += new EventHandler<Editor.EditEventArgs>(Editor_EditCompleted);
}
3) by clicking on the map i can select features on both layers L1 & L2 and obtain information about layers i'm working through the Editor_EditCompleted.
In the Editor_EditCompleted event i can understand on which layer i'm working because the properties e.Edits it's never null , and all it's ok.
4) Now i want to add selected polygons to current selection: i do that with keyboards in this way:
Press shif , click on map and new selected features are added
void MainPage_KeyDown(object sender, KeyEventArgs e)
{
if (_editor == null) return;
if (e.Key == Key.Ctrl)
_editor.Select.Execute("Remove");
else if (e.Key == Key.Shift)
_editor.Select.Execute("Add");
else if (e.Key == Key.Escape)
_editor.CancelActive.Execute(null);
}
.... and all it's ok
5) Now ( this is the trouble case ) i would like to deselect some objects from existing selection.
..Press ctrl and click on map.
The features are correctly deselected , but now the question is:
If i check the e.edits value in Editor_EditCompleted, i have this value null.
This means that i'm not be able to understand on which layer the selected object are deselected.
Let me know if i was clear in my explanation
Ciao Giorgio
when i click on map i can salect a poligon on each layer. I would like to understand on which layer im' working against not when i select a poligon but when i deselecte objects from one of 2 layer.
Infact, the e.edits return a Layer not null when i add the selection , null when i remove the selection.