コード例 #1
0
 public void Shout()
 {
     Console.WriteLine($"喵~,我是{name}。");
     if (CatShout != null)
     {
         CatShoutEventArgs args = new CatShoutEventArgs();
         args.Name = this.name;
         CatShout(this, args);
     }
 }
コード例 #2
0
ファイル: Mouse.cs プロジェクト: linlvdou/CoreStudy
 public void Run(object sender, CatShoutEventArgs args)
 {
     Console.WriteLine($"老猫{args.Name}来了,{name}快!");
 }