Class Weather
- Namespace
- SimpleWeather
- Assembly
- SimpleWeather.dll
Represents a single entry from the OpenWeather weather collection.
public class Weather
- Inheritance
-
Weather
- Inherited Members
Constructors
Weather()
Initializes a new, empty instance of the Weather class.
public Weather()
Weather(JToken?)
Initializes a new instance of the Weather class from a JSON token.
public Weather(JToken? data)
Parameters
dataJTokenThe JSON array that contains the weather description.
Properties
Description
Weather condition within the group
public string? Description { get; init; }
Property Value
ID
Weather condition ID
public int ID { get; init; }
Property Value
Icon
Weather icon ID
public string? Icon { get; init; }
Property Value
Main
Group of weather parameters (Rain, Snow, Extreme etc.)
public string? Main { get; init; }
Property Value
Methods
GetIconUrl(WeatherIconResolution)
Builds the CDN URL for this weather icon using the documented OpenWeather pattern.
public string? GetIconUrl(WeatherIconResolution resolution = WeatherIconResolution.DoubleScale)
Parameters
resolutionWeatherIconResolutionDesired image scale (1x, 2x, or 4x).
Returns
- string
The full icon URL or
nullwhen the icon code is unavailable.