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

            return(ResponseFactory.CreateResponse(result));
        }
예제 #2
0
        public static Parser CreateParser(IDecodeRequest request, WeatherProductType productType)
        {
            switch (productType)
            {
            case WeatherProductType.METAR:
                return(new MetarParser(request));

            case WeatherProductType.TAF:
                return(new TafParser(request));

            case WeatherProductType.SIGMET:
                return(new SigmetParser(request));

            default:
                throw new NotSupportedException();
            }
        }