C# Class WeatherAPI.WeatherAPI

Gateway class to the WeatherAPI.
/// Thrown when an argument passed to a method is invalid. ///
显示文件 Open project: johnluetke/WeatherAPI

Public Methods

Method Description
GetWeather ( double latitude, double longitude ) : IWeather

Gets the weather for the given latitude and longitude

GetWeather ( int zipCode ) : IWeather

Gets the weather for the given ZIP code

GetWeather ( string airportCode ) : IWeather

Gets the weather for the given airport code

GetWeather ( string city, string state ) : IWeather

Gets the weather for the given city and state

This is the most general level for which weather can be retrieved.

Private Methods

Method Description
WeatherAPI ( ) : System

Initializes a new instance of the WeatherAPI class. All providers discovered via reflection and added to a List for use in getInstance

getInstance ( LocationType sourceType, string source ) : IWeather

Factory method for obtaining an instance of a provider

Method Details

GetWeather() public static method

Gets the weather for the given latitude and longitude
public static GetWeather ( double latitude, double longitude ) : IWeather
latitude double /// The latitude coordinate for which weather information should be /// retrieved. ///
longitude double /// The latitude coordinate for which weather information should be /// retrieved. ///
return IWeather

GetWeather() public static method

Gets the weather for the given ZIP code
public static GetWeather ( int zipCode ) : IWeather
zipCode int /// The ZIP code for which weather information should be retrieved. ///
return IWeather

GetWeather() public static method

Gets the weather for the given airport code
public static GetWeather ( string airportCode ) : IWeather
airportCode string /// The Airport code for which weather information should be retrieved. ///
return IWeather

GetWeather() public static method

Gets the weather for the given city and state
This is the most general level for which weather can be retrieved.
public static GetWeather ( string city, string state ) : IWeather
city string /// City name for which weather information should be retrieved ///
state string /// State name for which weather information should be retrieved ///
return IWeather