async void HandleLocationChanged(object sender, LocationEventArgs e){ var weather = await _restService.GetWeather (e.Longtitude, e.Latitude); if (_cachedWeather == null || (_cachedWeather.Temperature != weather.Temperature || _cachedWeather.WeatherCondition != weather.WeatherCondition)) { _cachedWeather = weather; _messenger.Publish (new WeatherChangedMessage (this, weather.Temperature, weather.WeatherCondition)); } }
async void HandleLocationChanged(object sender, LocationEventArgs e) { var weather = await _restService.GetWeather(e.Longtitude, e.Latitude); if (_cachedWeather == null || (_cachedWeather.Temperature != weather.Temperature || _cachedWeather.WeatherCondition != weather.WeatherCondition)) { _cachedWeather = weather; _messenger.Publish(new WeatherChangedMessage(this, weather.Temperature, weather.WeatherCondition)); } }
public WeatherEntity DtoToEntity(){ var result = new WeatherEntity (); result.Temperature = Temperature; WeatherCondition condition; Enum.TryParse<WeatherCondition> (WeatherCondition, out condition); result.WeatherCondition = condition; if (result.WeatherCondition.Equals (default(WeatherCondition))) { Debug.WriteLine ("Unknow switch - {0}", WeatherCondition); } return result; }
public WeatherEntity DtoToEntity() { var result = new WeatherEntity(); result.Temperature = Temperature; WeatherCondition condition; Enum.TryParse <WeatherCondition> (WeatherCondition, out condition); result.WeatherCondition = condition; if (result.WeatherCondition.Equals(default(WeatherCondition))) { Debug.WriteLine("Unknow switch - {0}", WeatherCondition); } return(result); }