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