// public Action _eventCatShout; public void Shout() { Console.WriteLine("Miao,I am {0}.",_strName); if (_eventCatShout != null) { CatShoutEventArgs e = new CatShoutEventArgs {StrName = this._strName}; _eventCatShout(this,e); } }
// public Action _eventCatShout; public void Shout() { Console.WriteLine("Miao,I am {0}.", _strName); if (_eventCatShout != null) { CatShoutEventArgs e = new CatShoutEventArgs { StrName = this._strName }; _eventCatShout(this, e); } }
public void Run(object sender, CatShoutEventArgs args) { Console.WriteLine("老猫{0}来了, {1}快跑! ", args.StrName,_strName); }
public void Run(object sender, CatShoutEventArgs args) { Console.WriteLine("老猫{0}来了, {1}快跑! ", args.StrName, _strName); }