Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CheckWxServices"/> class.
        /// </summary>
        /// <param name="apiKey">The API key.</param>
        /// <param name="apiBaseUrl">The API base URL.</param>
        /// <param name="metarTafCacheTimeInMinutes">The amount of time the METARs and TAFs are cached on the server (HttpRuntimeCache). Defaults to 30 minutes as dictated by the API developers. Set to 0 to disable caching (not recommended due to the 2000 request limit per day!)</param>
        /// <param name="stationCacheTimeInMinutes">The amount of time the stations are cached on the server (HttpRuntimeCache). Defaults to 43200 minutes (30 days) as dictated by the API developers. Set to 0 to disable caching (not recommended due to the 2000 request limit per day!)</param>
        public CheckWxServices(string apiKey, string apiBaseUrl, int metarTafCacheTimeInMinutes, int stationCacheTimeInMinutes)
        {
            Stations = new StationService(apiKey, apiBaseUrl, metarTafCacheTimeInMinutes, stationCacheTimeInMinutes, AcceptHeaderJson);
            Metars   = new MetarService(apiKey, apiBaseUrl, metarTafCacheTimeInMinutes, stationCacheTimeInMinutes, AcceptHeaderJson);
            Tafs     = new TafService(apiKey, apiBaseUrl, metarTafCacheTimeInMinutes, stationCacheTimeInMinutes, AcceptHeaderJson);

            JsonStations = new RawStationService(apiKey, apiBaseUrl, metarTafCacheTimeInMinutes, stationCacheTimeInMinutes, AcceptHeaderJson);
            JsonTafs     = new RawTafService(apiKey, apiBaseUrl, metarTafCacheTimeInMinutes, stationCacheTimeInMinutes, AcceptHeaderJson);
            JsonMetars   = new RawMetarService(apiKey, apiBaseUrl, metarTafCacheTimeInMinutes, stationCacheTimeInMinutes, AcceptHeaderJson);

            XmlStations = new RawStationService(apiKey, apiBaseUrl, metarTafCacheTimeInMinutes, stationCacheTimeInMinutes, AcceptHeaderXml);
            XmlTafs     = new RawTafService(apiKey, apiBaseUrl, metarTafCacheTimeInMinutes, stationCacheTimeInMinutes, AcceptHeaderXml);
            XmlMetars   = new RawMetarService(apiKey, apiBaseUrl, metarTafCacheTimeInMinutes, stationCacheTimeInMinutes, AcceptHeaderXml);
        }
Пример #2
0
 internal TafService(string apiKey, string apiBaseUrl, int metarTafCacheTimeInMinutes, int stationCacheTimeInMinutes, string acceptHeader)
 {
     _jsonTafService = new RawTafService(apiKey, apiBaseUrl, metarTafCacheTimeInMinutes, stationCacheTimeInMinutes, acceptHeader);
     _tafFactory     = new TafFactory();
 }