Ejemplo n.º 1
0
        public Form1()
        {
            InitializeComponent();

            speedMonitorSubject = new SpeedMonitorSubject();    // must create SpeedMonitorSubject first - we need to pass
                                                                // it in when we call an observer's constructor
            rpmObserver = new RPMObserver(lblRPM, speedMonitorSubject);
            caloriesObserver = new CaloriesObserver(lblCaloriesPerHour, speedMonitorSubject);
            kmsPerHourObserver = new KMsPerHourObserver(lblKMPerHour, speedMonitorSubject);
        }
Ejemplo n.º 2
0
        public Form1()
        {
            InitializeComponent();

            speedMonitorSubject = new SpeedMonitorSubject();    // must create SpeedMonitorSubject first - we need to pass
                                                                // it in when we call an observer's constructor
            rpmObserver        = new RPMObserver(lblRPM, speedMonitorSubject);
            caloriesObserver   = new CaloriesObserver(lblCaloriesPerHour, speedMonitorSubject);
            kmsPerHourObserver = new KMsPerHourObserver(lblKMPerHour, speedMonitorSubject);
        }