Beispiel #1
0
 //声明一个可重写的OnPublish的保护函数
 protected virtual void OnPublish(PubEventArgs e)
 {
     if (Publish != null)
     {
         //Sender = this,也就是Publisher
         this.Publish(this, e);
     }
 }
Beispiel #2
0
 //对事件感兴趣的事情
 public static void Receive(object sender, PubEventArgs e)
 {
     Console.WriteLine("Child,you are 21, we don't see《Hokage Ninjia》,SB Xiao Mi!");
     Console.WriteLine("This is my order《" + e.magazineName + "》,oh yeah!");
 }
Beispiel #3
0
 //对事件感兴趣的事情
 public static void Receive(object sender, PubEventArgs e)
 {
     Console.WriteLine("Haha, I have recived the latest《" + e.magazineName + "》!!");
 }