Beispiel #1
0
        public void SimulateTemperatureTooHigh(int detectedtemperature)
        {
            TemperatureEventArgs args = new TemperatureEventArgs()
            {
                DetectedTemperature = detectedtemperature
            };

            if (TemperatureTooHigh != null && detectedtemperature > 25)
            {
                foreach (var item in TemperatureTooHigh.GetInvocationList())
                {
                    TemperatureEventHandler t_eh = (TemperatureEventHandler)item;
                    t_eh(this, args);
                }
            }
        }
Beispiel #2
0
 private void _t_TemperatureTooHigh(object sender, TemperatureEventArgs args)
 {
     Console.WriteLine("I'm Subscriber1 \r\n Detected Temperature: {0} is too hoigh", args.DetectedTemperature);
 }