Example #1
0
    public void GetPoints( GeoCluster geoCluster, AsyncCallback<BackendlessCollection<GeoPoint>> callback )
    {
      try
      {
        var responder = new AsyncCallback<BackendlessCollection<GeoPoint>>( r =>
        {
          r.Query = geoCluster.GeoQuery;

          foreach( GeoPoint geoPoint in r.Data )
            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[] { Backendless.AppId, Backendless.VersionNum, 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;
      }
    }
Example #2
0
    public BackendlessCollection<GeoPoint> GetPoints( GeoCluster geoCluster )
    {
      Object[] args = new Object[] { Backendless.AppId, Backendless.VersionNum, geoCluster.ObjectId, geoCluster.GeoQuery };
      BackendlessCollection<GeoPoint> result = Invoker.InvokeSync<BackendlessCollection<GeoPoint>>( GEO_MANAGER_SERVER_ALIAS, "loadGeoPoints", args );

      result.Query = geoCluster.GeoQuery;
      return result;
    }