Table of Contents

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

data JToken

The JSON array that contains the weather description.

Properties

Description

Weather condition within the group

public string? Description { get; init; }

Property Value

string

ID

Weather condition ID

public int ID { get; init; }

Property Value

int

Icon

Weather icon ID

public string? Icon { get; init; }

Property Value

string

Main

Group of weather parameters (Rain, Snow, Extreme etc.)

public string? Main { get; init; }

Property Value

string

Methods

GetIconUrl(WeatherIconResolution)

Builds the CDN URL for this weather icon using the documented OpenWeather pattern.

public string? GetIconUrl(WeatherIconResolution resolution = WeatherIconResolution.DoubleScale)

Parameters

resolution WeatherIconResolution

Desired image scale (1x, 2x, or 4x).

Returns

string

The full icon URL or null when the icon code is unavailable.