Esempio n. 1
0
        public void UpdateStatus(string weather, bool status)
        {
            if (OnUpdateStatus == null)
            {
                return;
            }

            WeatherNotificationArgs args = new WeatherNotificationArgs(weather, status);

            OnUpdateStatus(this, args);
        }
Esempio n. 2
0
        private void ProcessWeatherChanges(object sender, WeatherNotificationArgs e)
        {
            if (e.Weather == "WhiteOut")
            {
                if (e.Present)
                {
                    CurrentConditionsN = CurrentConditionsN | CurrentWeather.WhiteOut;
                }
                else
                {
                    CurrentConditionsN = CurrentConditionsN.RemoveFlags(CurrentWeather.WhiteOut);
                }
            }

            if (e.Weather == "ThunderFrenzy")
            {
                if (e.Present)
                {
                    CurrentConditionsN = CurrentConditionsN | CurrentWeather.ThunderFrenzy;
                }
                else
                {
                    CurrentConditionsN = CurrentConditionsN.RemoveFlags(CurrentWeather.ThunderFrenzy);
                }
            }

            if (e.Weather == "Fog")
            {
                if (e.Present)
                {
                    CurrentConditionsN = CurrentConditionsN | CurrentWeather.Fog;
                }
                else
                {
                    CurrentConditionsN = CurrentConditionsN.RemoveFlags(CurrentWeather.Fog);
                }
            }

            if (e.Weather == "Blizzard")
            {
  
                if (e.Present)
                    CurrentConditionsN = CurrentConditionsN | CurrentWeather.Blizzard;
                else
                    CurrentConditionsN = CurrentConditionsN.RemoveFlags(CurrentWeather.Blizzard);
            }
        }