예제 #1
0
 public RpmObserver(Label label, BicycleSubject bicycleSubject)
     : base(label, bicycleSubject)
 {
     this.label = label;
     this.bicycleSubject = bicycleSubject;
     currentRpm = 0;
     currComputedValue = 0;
     bicycleSubject.AddObserver(this);
 }
예제 #2
0
        public Form1()
        {
            InitializeComponent();

            bicycleSubject = new BicycleSubject();
            rpmObserver = new RpmObserver(lblRpm, bicycleSubject);
            caloriesObserver = new CaloriesPerHourObserver(lblCalories, bicycleSubject);
            kmsObserver = new KmPerHourObserver(lblKms, bicycleSubject);
        }