Esempio n. 1
0
 public Form1()
 {
     InitializeComponent();
     bikeSubject = new BicycleSubject(0);
     rpm         = new RPMCalc(labelRPM, bikeSubject);
     calorie     = new CalorieCalc(labelCalories, bikeSubject);
     dist        = new DistanceCalc(labelDistance, bikeSubject);
 }
Esempio n. 2
0
 public Form1()
 {
     InitializeComponent();
     bikeSubject = new BicycleSubject(0);
     rpm = new RPMCalc(labelRPM, bikeSubject);
     calorie = new CalorieCalc(labelCalories, bikeSubject);
     dist = new DistanceCalc(labelDistance, bikeSubject);
 }
Esempio n. 3
0
        public BicycleObserver(Label displayLabel, BicycleSubject bikeSubject)
        {
            this.displayLabel = displayLabel;

            currRpm = 0;
            currComputedValue = 0;
            this.bikeSubject = bikeSubject;
            //much important. sign observer to subject
            bikeSubject.addObserver(this);
        }
Esempio n. 4
0
        public BicycleObserver(Label displayLabel, BicycleSubject bikeSubject)
        {
            this.displayLabel = displayLabel;

            currRpm           = 0;
            currComputedValue = 0;
            this.bikeSubject  = bikeSubject;
            //much important. sign observer to subject
            bikeSubject.addObserver(this);
        }
Esempio n. 5
0
 public DistanceCalc(Label displayLabel, BicycleSubject bikeSubject)
     : base(displayLabel, bikeSubject)
 {
 }
Esempio n. 6
0
 public CalorieCalc(Label displayLabel, BicycleSubject bikeSubject)
     : base(displayLabel, bikeSubject)
 {
 }
Esempio n. 7
0
 public RPMCalc(Label displayLabel, BicycleSubject bikeSubject)
     : base(displayLabel, bikeSubject)
 {
 }
Esempio n. 8
0
 public DistanceCalc(Label displayLabel, BicycleSubject bikeSubject)
     : base(displayLabel, bikeSubject)
 {
 }