public void UpdateEntrances(double lat, double lon, int radiusInMeters = 500) { string url = GetApiKeyMultiple(BaseUrl + String.Format("Rail.svc/StationEntrances?lat={0}&lon={1}&radius={2}", lat, lon, radiusInMeters)); GetXmlFromUrl(url, data => { Entrances = MetroBuilder <StationEntrance> .Build(data, "Entrances"); EntrancesUpdated(null, null); }); }
public void UpdateLines() { string url = GetApiKeySingle(BaseUrl + "Rail.svc/Lines"); GetXmlFromUrl(url, data => { Lines = MetroBuilder <LineInfo> .Build(data, "Lines"); LinesUpdated(null, null); }); }
public void UpdateArrivalTimes(List <StationInfo> stations) { if (stations != null) { // cache the stations whos arrival times we want to know, if we get a null use the cached value to refresh _arrivalStations = stations; } string url = GetApiKeySingle(BaseUrl + "StationPrediction.svc/GetPrediction/" + _arrivalStations.FoldToCommaDelimitedList(s => s.Code)); GetXmlFromUrl(url, data => { ArrivalTimes = MetroBuilder <TrainArrivalTime> .Build(data, "Trains"); ArrivalsUpdated(null, null); }); }
public void UpdateStations(String lineCode) { string url; // get stations for a specific line if (lineCode != null) { string lineCodeString = "?LineCode=" + lineCode; url = GetApiKeyMultiple(BaseUrl + "Rail.svc/Stations" + lineCodeString); } // list all stations else { url = GetApiKeySingle(BaseUrl + "Rail.svc/Stations"); } GetXmlFromUrl(url, data => { Stations = MetroBuilder <StationInfo> .Build(data, "Stations"); StationsUpdated(null, null); }); }