public static void Main (string[] args) { var sender = new Sender (); var dog = new Dog (sender); var cat = new Cat (sender); sender.StartTimer (1000, "Before unregister"); dog.Unregister (sender); sender.StartTimer (2000, "After unregister"); }
public void Unregister (Sender sender) { sender.Mail -= Voice; }
public Dog (Sender sender) { sender.Mail += Voice; }
public Cat (Sender sender) { sender.Mail += Voice; }