Beispiel #1
0
 static void Main()
 {
     Publish eventPublisher = new Publish();
     new Subscriber("Pesho", eventPublisher); //create subscribers for the event
     new Subscriber("Gosho", eventPublisher);
     eventPublisher.RaiseSampleEvent();
 }
Beispiel #2
0
 public Subscriber(string name, Publish pub)
 {
     this.Name = name;
     pub.RaiseCustomEvent += HandleCustomEvent;
 }
Beispiel #3
0
 public Recipient(string name, Publish something)
 {
     this.name              = name;
     something.PublicEvent += this.EventHandler;
 }