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