private IDecodeResponse HandleGetInternal(IDecodeRequest request, WeatherProductType productType) { var parser = ParserFactory.CreateParser(request, productType); IWeatherProduct result = parser.Parse(); return(ResponseFactory.CreateResponse(result)); }
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(); } }