static void Main(string[] args)
        {
            TemperatureSensor   sensor    = new TemperatureSensor();
            TemperatureReporter reporter  = new TemperatureReporter();
            TemperatureReporter reporter2 = new TemperatureReporter();

            reporter.StartReporting(sensor);
            reporter2.StartReporting(sensor);
            sensor.GetTemperature();
            reporter2.StopReporting();
            sensor.GetTemperature();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            TemperatureSensor   monitor  = new TemperatureSensor();
            TemperatureReporter reporter = new TemperatureReporter();

            reporter.StartReporting(monitor);
            monitor.GetTemperature();
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            TemperatureSensor <Temperature>   sensor   = new TemperatureSensor <Temperature>();
            TemperatureReporter <Temperature> reporter = new TemperatureReporter <Temperature>();

            reporter.StartReporting(sensor);
            sensor.GetTemperature();
        }