コード例 #1
0
		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));
			}
		}
コード例 #2
0
        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));
            }
        }
コード例 #3
0
ファイル: WeatherDTO.cs プロジェクト: IGR777/TestLocation
		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;
		}
コード例 #4
0
ファイル: WeatherDTO.cs プロジェクト: IGR777/TestLocation
        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);
        }