/// <summary>
 /// Simplifies geometry that has just been edited by the user
 /// </summary>
 public static void SimplifyGraphicAsync(Graphic graphic, EventHandler<GraphicsEventArgs> callback)
 {
     List<Graphic> list = new List<Graphic> {graphic};
     ESRI.ArcGIS.Client.Tasks.GeometryService geometryService = new ESRI.ArcGIS.Client.Tasks.GeometryService(Url);
     geometryService.SimplifyCompleted -= geometryService_SimplifyCompleted;
     geometryService.SimplifyCompleted += geometryService_SimplifyCompleted;
     geometryService.SimplifyAsync(list, callback);
 }
    /// <summary>
    /// Projects a single geometry to the specified spatial reference.
    /// </summary>
    private static void ProjectAsync(Geometry geometry, SpatialReference spatialReference, EventHandler<GeometryEventArgs> callback)
    {
      CallbackHelper helper = new CallbackHelper(callback);

      ESRI.ArcGIS.Client.Tasks.GeometryService geometryService = new ESRI.ArcGIS.Client.Tasks.GeometryService(Url);

      geometryService.ProjectCompleted += helper.geometryService_ProjectCompleted;
      geometryService.ProjectAsync(new List<Graphic>(new Graphic[] { new Graphic() { Geometry = geometry } }), spatialReference);
    }
        /// <summary>
        /// Simplifies geometry that has just been edited by the user
        /// </summary>
        public static void SimplifyGraphicAsync(Graphic graphic, EventHandler <GraphicsEventArgs> callback)
        {
            List <Graphic> list = new List <Graphic> {
                graphic
            };

            ESRI.ArcGIS.Client.Tasks.GeometryService geometryService = new ESRI.ArcGIS.Client.Tasks.GeometryService(Url);
            geometryService.SimplifyCompleted -= geometryService_SimplifyCompleted;
            geometryService.SimplifyCompleted += geometryService_SimplifyCompleted;
            geometryService.SimplifyAsync(list, callback);
        }
        /// <summary>
        /// Projects a single geometry to the specified spatial reference.
        /// </summary>
        private static void ProjectAsync(Geometry geometry, SpatialReference spatialReference, EventHandler <GeometryEventArgs> callback)
        {
            CallbackHelper helper = new CallbackHelper(callback);

            ESRI.ArcGIS.Client.Tasks.GeometryService geometryService = new ESRI.ArcGIS.Client.Tasks.GeometryService(Url);

            geometryService.ProjectCompleted += helper.geometryService_ProjectCompleted;
            geometryService.ProjectAsync(new List <Graphic>(new Graphic[] { new Graphic()
                                                                            {
                                                                                Geometry = geometry
                                                                            } }), spatialReference);
        }