//public delegate public void Shout() { Console.WriteLine(string.Format("大家好,我是小猫:{0}",Name)); if (catShout != null) { CatShoutEventArgs e = new CatShoutEventArgs(); e.Name = this.Name; catShout(this,e); } }
public void run(object obj,CatShoutEventArgs e) { Console.WriteLine(string.Format("猫:{0}来了:{1}快跑。 ",e.Name, Name)); }