Beispiel #1
0
        public void Game()
        {
            Console.WriteLine("我要玩游戏喽!");

            CustomEventnArgs e = new CustomEventnArgs();

            e.Name   = _name;
            e.Number = _number;
            if (PlayGame != null)
            {
                PlayGame(this, e);
            }
        }
Beispiel #2
0
 public void Notify(object sender, CustomEventnArgs e)
 {
     Console.WriteLine("报告老板,{0}在{1}办公室玩游戏!", e.Name, ((Employee)sender).Number);
     //或者
     //Console.WriteLine("报告老板,{0}在{1}玩游戏!", e.Name, e.Number);
 }