Exemplo n.º 1
0
        //烧水
        public void BoilWater()
        {
            for (int i = 0; i < 100; i++)
            {
                temperature = i;
                if (temperature > 95)
                {
                    //建立BoiledEventArgs 对象
                    BoiledEventArgs e = new BoiledEventArgs(temperature);
                    OnBoiled(e);// 调用 OnBolied方法


                    //if (BoilEvent != null)//如果有对象注册
                    //{
                    //    BoilEvent(temperature);//调用注册的对象
                    //}
                    // MakeAlert(temperature);
                    //ShowMsg(temperature);
                }
            }
        }