public Form1() { InitializeComponent(); subject = new SpeedMonitorSubject(); rpm = new RPMObserver(lblRPM, subject); calories = new CaloriesObserver(lblCalories, subject); kilometeres = new KilometerObserver(lblKms, subject); }
//Constructor public BicycleObserver(Label displayLabel, SpeedMonitorSubject bikeSubject) { this.displayLabel = displayLabel; currentRPM = 0; currentComputedValue = 0; this.bikeSubject = bikeSubject; //Observers will sign themselves to the list bikeSubject.AddObserver(this); }
//Constructor public CaloriesObserver(Label displayLabel, SpeedMonitorSubject bikeSubject) : base(displayLabel, bikeSubject) { }
//Constructor public KilometerObserver(Label displayLabel, SpeedMonitorSubject bikeSubject) : base(displayLabel, bikeSubject) { }