Select to view content in your preferred language

how do I tell the changed graphics from  the editor.GraphicsLayer?

762
3
08-26-2012 07:09 AM
shanliu
Emerging Contributor
Now, I  do some edit work ,like this:http://resources.arcgis.com/en/help/silverlight-api/samples/start.htm#EditToolsExplicitSave

But ,I have more requirements. Before save edits, I must check the add/move/deleted/Uion/vertices ,and the check rule is these changed graphics be contained in the specfied area.

I dont't know how to do this?  Anyone can tell me?

1 how do I tell the changed graphics from  the editor.GraphicsLayer?
2 how do I know the graphics is contained in the specfied Geometry?
0 Kudos
3 Replies
SanajyJadhav
Deactivated User
For #1, I might do the following.

1. Subscribe to the PropertyChanged event of of the FeatureLayer.
2. Whenever edits are made to the feature layer,in this event you can check the value of the property 'HasEdits'.It becomes true in case of edits.

For #2,there are couple of approaches.You can use the property 'Intersects' on the Envelope class.

Hope this helps.
0 Kudos
shanliu
Emerging Contributor
Thank you ,sanjayjadhav .

I found how to tell the changed graphics.
Subscribe to the EditCompleted event of of the Editor.
if (e.Action == ESRI.ArcGIS.Client.Editor.EditAction.Add)
            {
                foreach (ESRI.ArcGIS.Client.Editor.Change change in e.Edits)
                {
                    if ( change.Graphic != null)
                    {
                       

                    }

                   
                }
            


But I still don't know how to tell the graphics is contained in the specfied Geometry?
if use Intersects ,like this[ATTACH=CONFIG]17280[/ATTACH],the rsult is wrong.
0 Kudos
DominiqueBroux
Esri Frequent Contributor
You can use the intersect geometry service (sample).
So you can get the geometry part that is inside the specified area.
Then, depending on your need, you can either save that geometry or cancel the save if that geometry is not equal to the initial geometry (i.e. a part is outside the specified area).
0 Kudos