コード例 #1
0
        public BicycleObserver(Label displayLabel, SpeedMonitorSubject bikeSubject)
        {
            this.displayLabel = displayLabel;

            currentRPM = 0;
            currentComputedValue = 0;
            this.bikeSubject = bikeSubject;

            // VERY IMPORTANT. Observers sign themselves up....
            bikeSubject.AddObserver(this);
        }