Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace HeadFirstDesignPatterns.Ch02TheObserverPattern.WeatherStationWithEventsAndDelegates
- {
- class CurrentConditionsDisplayWithEventsAndDelegates : IObserverWithEventsAndDelegates, DisplayElementWithEventsAndDelegates
- {
- private float temperature;
- private float humidity;
- public void Update(float temperature, float humidity, float pressure)
- {
- this.temperature = temperature;
- this.humidity = humidity;
- Display();
- }
- public void Display()
- {
- Console.WriteLine(String.Format("Current conditions: {0}F degrees and {1}% humidity", temperature, humidity));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement