public void SetData(WuLocation location) { locationLabel.Text = location?.Name; // redraw graph graphView.SetNeedsDisplay(); }
public void SetData (WuLocation location) { locationLabel.Text = location?.Name; // redraw graph graphView.SetNeedsDisplay (); }
public static DateTime LocalTime(this WuLocation location) { var tzId = location?.Location?.tz ?? location?.Conditions?.local_tz_long ?? location?.TodayForecast?.date?.tz_long; var now = DateTime.Now; if (string.IsNullOrWhiteSpace(tzId)) { return(now); } try { //var tzInfo = TimeZoneInfo.FindSystemTimeZoneById (location.Location.tz); return(TimeZoneInfo.ConvertTimeBySystemTimeZoneId(now, tzId)); } catch (TimeZoneNotFoundException tzEx) { System.Diagnostics.Debug.WriteLine(tzEx.Message); System.Diagnostics.Debug.WriteLine(tzId); return(now); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.Message); return(now); } }
public void SetData(WuLocation location) { currentImage.Hidden = !location.Current; nameLabel.Text = location.Name; timeLabel.Text = location?.LocalTimeString(); tempLabel.Text = location?.TempString(Settings.UomTemperature, true); }
public void RemoveLocation(WuLocation location) { Locations.Remove(location); Locations.Sort(); LocationRemoved?.Invoke(this, EventArgs.Empty); }
public static List<WeatherDetail> GetDetails (WuLocation location, TemperatureUnits temp, SpeedUnits speed, LengthUnits length, DistanceUnits distance, PressureUnits pressure) { var list = new List<WeatherDetail> (); for (int i = 0; i < Count; i++) list.Add (GetDetail (i, location, temp, speed, length, distance, pressure)); return list; }
public static WeatherDetail GetDetail(int row, WuLocation location, TemperatureUnits temp, SpeedUnits speed, LengthUnits length, DistanceUnits distance, PressureUnits pressure) { return(new WeatherDetail { DetailLabel = GetLabel(row), DetailValue = GetValue(row, location, temp, speed, length, distance, pressure), IsSectionTop = IsSectionTop(row) }); }
public static WeatherDetail GetDetail (int row, WuLocation location, TemperatureUnits temp, SpeedUnits speed, LengthUnits length, DistanceUnits distance, PressureUnits pressure) { return new WeatherDetail { DetailLabel = GetLabel (row), DetailValue = GetValue (row, location, temp, speed, length, distance, pressure), IsSectionTop = IsSectionTop (row) }; }
public void RemoveLocation(WuLocation location) { Locations.Remove(location); Locations.Sort(); LocationRemoved?.Invoke(this, EventArgs.Empty); SettingsStudio.Settings.LocationsJson = Locations.GetLocationsJson(); }
public static List <WeatherDetail> GetDetails(WuLocation location, TemperatureUnits temp, SpeedUnits speed, LengthUnits length, DistanceUnits distance, PressureUnits pressure) { var list = new List <WeatherDetail> (); for (int i = 0; i < Count; i++) { list.Add(GetDetail(i, location, temp, speed, length, distance, pressure)); } return(list); }
async Task <WuLocation> getWuLocation(WuAcLocation acLocation) { var location = new WuLocation(acLocation); location.Weather = await GetAsync <WuWeather> (acLocation.l); System.Diagnostics.Debug.WriteLine(location.Weather.ToJson()); location.Updated = DateTime.UtcNow; return(location); }
public void AddLocation(WuLocation location, bool preventNotification = false) { Locations.Add(location); Locations.Sort(); if (!preventNotification) { LocationAdded?.Invoke(this, EventArgs.Empty); SettingsStudio.Settings.LocationsJson = Locations.GetLocationsJson(); } }
public void SetData(WuLocation location) { conditionLabel.Text = location?.Conditions?.weather; dayLabel.Text = DateTime.Today.DayOfWeek.ToString(); highTempLabel.Text = location?.HighTempString(Settings.UomTemperature); locationLabel.Text = location?.Name; lowTempLabel.Text = location?.LowTempString(Settings.UomTemperature); precipLabel.Text = location.ProbabilityPercipString(); tempLabel.Text = location?.TempString(Settings.UomTemperature, true); todayLabel.Text = "Today"; //precipIcon.Text = null; //wuIcon.Text = null; }
public static string GetValue (int row, WuLocation location, TemperatureUnits temp, SpeedUnits speed, LengthUnits length, DistanceUnits distance, PressureUnits pressure) { var conditions = location?.Conditions; if (conditions == null) return string.Empty; switch (row) { case 0: return conditions.FeelsLikeString (temp, true, true); case 1: return location.SunriseString (); case 2: return location.SunsetString (); case 3: return location.ProbabilityPercipString (); case 4: return conditions.relative_humidity; case 5: return conditions.WindString (speed); case 6: return conditions.GustString (speed); case 7: return conditions.PrecipTodayString (length); case 8: return conditions.PressureString (pressure); case 9: return conditions.VisibilityString (distance); case 10: return location.Conditions.UV.ToString (); default: return string.Empty; } }
public static string GetValue(int row, WuLocation location, TemperatureUnits temp, SpeedUnits speed, LengthUnits length, DistanceUnits distance, PressureUnits pressure) { var conditions = location?.Conditions; if (conditions == null) { return(string.Empty); } switch (row) { case 0: return(conditions.FeelsLikeString(temp, true, true)); case 1: return(location.SunriseString()); case 2: return(location.SunsetString()); case 3: return(location.ProbabilityPercipString()); case 4: return(conditions.relative_humidity); case 5: return(conditions.WindString(speed)); case 6: return(conditions.GustString(speed)); case 7: return(conditions.PrecipTodayString(length)); case 8: return(conditions.PressureString(pressure)); case 9: return(conditions.VisibilityString(distance)); case 10: return(location.Conditions.UV.ToString()); default: return(string.Empty); } }
public static string LocalTimeString(this WuLocation location, bool lowercase = true) => lowercase?location?.LocalTime().ToShortTimeString().ToLower() : location?.LocalTime().ToShortTimeString();
public void SetData(WuLocation location) { conditionLabel.Text = location?.ForecastString(Settings.UomTemperature); locationLabel.Text = location?.Name; //wuIcon.Text = null; }
public static Tuple <Color [], int> GetTimeOfDayGradient(this WuLocation location, bool random = false) { var index = location.GetTimeOfDayIndex(random); return(new Tuple <Color [], int> (Colors.Gradients [index], index)); }
public void SetData (WuLocation location) { nameLabel.Text = location.Name; timeLabel.Text = location?.LocalTimeString (); tempLabel.Text = location?.TempString (Settings.UomTemperature, true); }
public void SetData(WuLocation location) { nameLabel.Text = location.Name; timeLabel.Text = location?.LocalTimeString(); tempLabel.Text = location?.TempString(Settings.UomTemperature, true); }