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