Exemple #1
0
        private IDecodeResponse HandleGetInternal(IDecodeRequest request, WeatherProductType productType)
        {
            var             parser = ParserFactory.CreateParser(request, productType);
            IWeatherProduct result = parser.Parse();

            return(ResponseFactory.CreateResponse(result));
        }
Exemple #2
0
        public static IDecodeResponse CreateResponse(IWeatherProduct weatherProduct)
        {
            switch (weatherProduct.Type)
            {
            case WeatherProductType.METAR:
                return(new DecodeMetarResponse((Metar)weatherProduct));

            case WeatherProductType.TAF:
                return(new DecodeTafResponse((Taf)weatherProduct));

            case WeatherProductType.SIGMET:
                return(new DecodeSigmetResponse((Sigmet)weatherProduct));

            default:
                throw new NotSupportedException("Invalid weather product type");
            }
        }