Пример #1
0
 public void BoilWater()
 {
     for (int i = 0; i <= 100; i++)
     {
         temperature = i;
         if (temperature >= 95)
         {
             BoiledEventArgs e = new BoiledEventArgs(temperature, type);
             OnBoiled(e);
         }
     }
 }
Пример #2
0
 protected virtual void OnBoiled(BoiledEventArgs e)
 {
     base.Notify(e);
 }
Пример #3
0
 public static void Display(Object sender, BoiledEventArgs e)
 {
     Console.WriteLine("水开啦,当前温度:{0},型号:{1}", e.temperature, ((Heater)sender).type);
 }