Example #1
0
        internal MapLocationFinderResult(RestResponse restResponse)
        {
            var locations = new List <MapLocation>();

            Locations = locations;

            try
            {
                foreach (var resourceSet in restResponse.resourceSets)
                {
                    foreach (var resource in resourceSet.resources)
                    {
                        var mapLocation = new MapLocation(resource.name, resource.point, resource.address, resource.entityType);
                        locations.Add(mapLocation);
                    }
                }
            }
            catch (Exception)
            {
                Status = MapLocationFinderStatus.BadResponse;
                return; // Early out.
            }

            Status = locations.Count > 0 ? MapLocationFinderStatus.Success : MapLocationFinderStatus.EmptyResponse;
        }
Example #2
0
 internal MapLocationFinderResult(
     IReadOnlyList <MapLocation> locations,
     MapLocationFinderStatus status
     )
 {
     Locations = locations;
     Status    = status;
 }
Example #3
0
 internal MapLocationFinderResult(MapLocationFinderStatus status)
 {
     Locations = new List <MapLocation>();
     Status    = status;
 }