public Form1()
        {
            InitializeComponent();

            subject = new SpeedMonitorSubject();

            rpm         = new RPMObserver(lblRPM, subject);
            calories    = new CaloriesObserver(lblCalories, subject);
            kilometeres = new KilometerObserver(lblKms, subject);
        }
Exemple #2
0
        //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)
 {
 }
Exemple #4
0
 //Constructor
 public KilometerObserver(Label displayLabel, SpeedMonitorSubject bikeSubject)
     : base(displayLabel, bikeSubject)
 {
 }