Пример #1
0
        public void GetPoints(GeoCluster geoCluster, AsyncCallback <IList <GeoPoint> > callback)
        {
            try
            {
                var responder = new AsyncCallback <IList <GeoPoint> >(r =>
                {
                    foreach (GeoPoint geoPoint in r)
                    {
                        if (geoPoint is GeoCluster)
                        {
                            ((GeoCluster)geoPoint).GeoQuery = geoCluster.GeoQuery;
                        }
                    }

                    if (callback != null)
                    {
                        callback.ResponseHandler.Invoke(r);
                    }
                }, f =>
                {
                    if (callback != null)
                    {
                        callback.ErrorHandler.Invoke(f);
                    }
                    else
                    {
                        throw new BackendlessException(f);
                    }
                });

                Object[] args = new Object[] { geoCluster.ObjectId, geoCluster.GeoQuery };
                Invoker.InvokeAsync(GEO_MANAGER_SERVER_ALIAS, "loadGeoPoints", args, responder);
            }
            catch (System.Exception ex)
            {
                if (callback != null)
                {
                    callback.ErrorHandler.Invoke(new BackendlessFault(ex));
                }
                else
                {
                    throw;
                }
            }
        }
Пример #2
0
 public async Task <IList <GeoPoint> > GetPointsAsync(GeoCluster geoCluster)
 {
     return(await Task.Run(() => GetPoints( geoCluster )).ConfigureAwait(false));
 }
Пример #3
0
        public IList <GeoPoint> GetPoints(GeoCluster geoCluster)
        {
            var args = new object[] { geoCluster.ObjectId, geoCluster.GeoQuery };

            return(Invoker.InvokeSync <IList <GeoPoint> >(GEO_MANAGER_SERVER_ALIAS, "loadGeoPoints", args));
        }