Beispiel #1
0
        /// <summary>
        /// ObserverFunction as a function
        /// </summary>
        public void ObserverFunction()
        {
            WheatherStation station         = new WheatherStation();
            PhoneDisplay    phoneDisplay    = new PhoneDisplay(station);
            ComputerDisplay computerDisplay = new ComputerDisplay(station);

            phoneDisplay.Update();
            computerDisplay.Update();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="PhoneDisplay"/> class.
 /// </summary>
 /// <param name="weatherStation">weatherStation as a parameter</param>
 public PhoneDisplay(WheatherStation weatherStation)
 {
     this.wheatherStation = weatherStation;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ComputerDisplay"/> class.
 /// </summary>
 /// <param name="wheatherStation">weatherStation as a parameter</param>
 public ComputerDisplay(WheatherStation wheatherStation)
 {
     this.wheatherStation = wheatherStation;
 }