Advertisement
Fhernd

WeatherDataWithEventsAndDelegates.cs

Mar 13th, 2013
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.62 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace HeadFirstDesignPatterns.Ch02TheObserverPattern.WeatherStationWithEventsAndDelegates
  8. {
  9.     class WeatherObjectWithEventsAndDelegates
  10.     {
  11.         public delegate void NotifityObserversHandler(float temperature, float humidity, float pressure);
  12.         public event NotifityObserversHandler MeasurementsChanged;
  13.  
  14.         public void NewWeather(float temperature, float humidity, float pressure)
  15.         {
  16.             MeasurementsChanged(temperature, humidity, pressure);
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement