myGeomSer.ProjectAsync(myListOfPoints, mapControl1.map1.SpatialReference);
if (myGeomSer.IsBusy) { myGeomSer.CancelAsync(); myGeomSer.ProjectAsync(myListOfPoints, mapControl1.map1.SpatialReference); } else { myGeomSer.ProjectAsync(myListOfPoints, mapControl1.map1.SpatialReference); }
myGeomSer_ProjectCompleted(object sender, ESRI.ArcGIS.Client.Tasks.GraphicsEventArgs e)
Solved! Go to Solution.
GeometryService myGeomSer; string currentUserToken; private void ProjectGraphics(List<Graphic> myListOfPoints) { if (myGeomSer != null && myGeomSer.IsBusy) { myGeomSer.CancelAsync(); } myGeomSer = new GeometryService(serviceURL); myGeomSer.ProjectCompleted += geometryService_ProjectCompleted; myGeomSer.Failed += GeometryService_Failed; currentUserToken = Convert.ToString(DateTime.Now.Ticks); //use any unique value like GUID myGeomSer.ProjectAsync(myListOfPoints, mapControl1.map1.SpatialReference, currentUserToken); } private void geometryService_ProjectCompleted(object sender, GraphicsEventArgs e) { if (Convert.ToString( e.UserState)==currentUserToken) { // } }
GeometryService myGeomSer; string currentUserToken; private void ProjectGraphics(List<Graphic> myListOfPoints) { if (myGeomSer != null && myGeomSer.IsBusy) { myGeomSer.CancelAsync(); } myGeomSer = new GeometryService(serviceURL); myGeomSer.ProjectCompleted += geometryService_ProjectCompleted; myGeomSer.Failed += GeometryService_Failed; currentUserToken = Convert.ToString(DateTime.Now.Ticks); //use any unique value like GUID myGeomSer.ProjectAsync(myListOfPoints, mapControl1.map1.SpatialReference, currentUserToken); } private void geometryService_ProjectCompleted(object sender, GraphicsEventArgs e) { if (Convert.ToString( e.UserState)==currentUserToken) { // } }