Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Donghuan-He/WeatherData.cs
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
65 lines (43 sloc)
1.44 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Newtonsoft.Json; | |
namespace WeatherApp | |
{ | |
public class WeatherData | |
{ | |
/// <summary> | |
/// | |
/// </summary> | |
public string Title { get; set; }= "Get Weather"; | |
public bool IsEnabled { get; set; } = true; | |
[JsonProperty("city")] | |
public string City { get; set; } | |
[JsonProperty("country")] | |
public string Country { get; set; } | |
[JsonProperty("latitude")] | |
public string Latitude { get; set; } | |
[JsonProperty("longitude")] | |
public string Longitude { get; set; } | |
[JsonProperty("day")] | |
public Weather Weather { get; set; } | |
[JsonProperty("updateTimeFormat")] | |
public string UpdateTimeFormat { get; set; } | |
} | |
public class Weather | |
{ | |
[JsonProperty("temperature")] | |
public string Temperature { get; set; } = "0"; | |
[JsonProperty("narrative")] | |
public string Narrative { get; set; } | |
[JsonProperty("windSpeed")] | |
public string WindSpeed { get; set; } = "0"; | |
[JsonProperty("humidity")] | |
public string Humidity { get; set; } = "0"; | |
[JsonProperty("altimeter")] | |
public string Altimeter { get; set; } = "0"; | |
[JsonProperty("phrase")] | |
public string Phrase { get; set; } | |
[JsonProperty("sunrise")] | |
public string Sunrise { get; set; } | |
[JsonProperty("sunset")] | |
public string Sunset { get; set; } | |
} | |
} |