예제 #1
0
        public void MakeAlert(object sender, BoildEventArgs e)
        {
            StandardEvent heater = (StandardEvent)sender;

            Console.WriteLine($"滴滴滴滴,温度超过{heater.temperature}");
            Console.WriteLine("{0},{1}", heater.type, heater.name);
        }
예제 #2
0
        public static void DisplayTemperature(object sender, BoildEventArgs e)
        {
            StandardEvent heater = (StandardEvent)sender;

            Console.WriteLine($"温度{heater.temperature}");
            Console.WriteLine("{0},{1}", heater.type, heater.name);
        }
예제 #3
0
        public void BoilWater()
        {
            for (int i = 0; i < 100; i++)
            {
                temperature = i;
            }

            if (temperature >= 96)
            {
                BoildEventArgs e = new BoildEventArgs(temperature);
                BoilEvent?.Invoke(this, e);
            }
        }