Ejemplo n.º 1
0
        public void SetCurrentConditions(String weatherDescription)
        {
            this.CurrentConditions = weatherDescription;
            // Depending on the original use case of validating rainy or sunny days,
            // Instantiate the weatherAlert interface with the appropriate class
            if (weatherDescription == "rainy")
            {
                weatherAlert = new Phone();
                String alert = weatherAlert.GenerateWeatherAlert(weatherDescription);
                Console.WriteLine(alert);
            }

            if (weatherDescription == "sunny")
            {
                weatherAlert = new Emailer();
                String alert = weatherAlert.GenerateWeatherAlert(weatherDescription);
                Console.WriteLine(alert);
            }
        }
 public WeatherAlertViewModel(IWeatherAlert model)
 {
     DisplayName = "Weather alerts";
     _alert      = model;
 }
Ejemplo n.º 3
0
 public FogDecorator(IWeatherAlert weather) : base(weather)
 {
 }
Ejemplo n.º 4
0
 public Decorator(IWeatherAlert weather)
 {
     this.weather = weather;
 }
Ejemplo n.º 5
0
 public SnowDecorator(IWeatherAlert weather) : base(weather)
 {
 }
Ejemplo n.º 6
0
 public RainDecorator(IWeatherAlert weather) : base(weather)
 {
 }
Ejemplo n.º 7
0
 public WindDecorator(IWeatherAlert weather) : base(weather)
 {
 }
 public WeatherAlertViewModel(IWeatherAlert model)
 {
     DisplayName = "Weather alerts";
     _alert = model;
 }
Ejemplo n.º 9
0
 public WeatherAlertViewModelSample()
 {
     _alert = new WeatherAlert(DateTime.Now.AddHours(2), "", DateTime.Now, "ETC", "Bad Weather", "Weather Alert", "crap");
 }
 public WeatherAlertViewModelSample()
 {
     _alert = new WeatherAlert(DateTime.Now.AddHours(2),"", DateTime.Now, "ETC", "Bad Weather","Weather Alert", "crap");
 }