private void HandleResponse(string jsonResponse, Action<PropertyDataSourceResult> callback)
        {
            JObject json = JObject.Parse(jsonResponse);

              string responseCode = (string)json["response"]["application_response_code"];

              if (responseCode == "100" || /* one unambiguous location */
              responseCode == "101" || /* best guess location */
              responseCode == "110"  /* large location, 1000 matches max */)
              {
            var result = new PropertyListingsResult(json);
            callback(result);

              }
              else if (responseCode == "200" || /* ambiguous location */
               responseCode == "202" /* mis-spelled location */)
              {
            var result = new PropertyLocationsResult(json);
            callback(result);
              }
              else
              {
            /*
            201 - unkown location
            210 - coordinate error
            */
            callback(new PropertyUnknownLocationResult());
              };
        }
Esempio n. 2
0
        private void HandleResponse(string jsonResponse, Action <PropertyDataSourceResult> callback)
        {
            JObject json = JObject.Parse(jsonResponse);

            string responseCode = (string)json["response"]["application_response_code"];

            if (responseCode == "100" || /* one unambiguous location */
                responseCode == "101" || /* best guess location */
                responseCode == "110" /* large location, 1000 matches max */)
            {
                var result = new PropertyListingsResult(json);
                callback(result);
            }
            else if (responseCode == "200" || /* ambiguous location */
                     responseCode == "202" /* mis-spelled location */)
            {
                var result = new PropertyLocationsResult(json);
                callback(result);
            }
            else
            {
                /*
                 * 201 - unkown location
                 * 210 - coordinate error
                 */
                callback(new PropertyUnknownLocationResult());
            };
        }
   public SearchResultsPresenter(INavigationService navigationService, PropertyCrossPersistentState state,
 PropertyListingsResult results, SearchItemBase searchItem, PropertyDataSource dataSource)
   {
       _state = state;
         _navigationService = navigationService;
         _searchItem = searchItem;
         _dataSource = dataSource;
         _properties = results.Data;
         _totalResult = results.TotalResult;
         _totalPages = results.TotalPages;
   }