public void Run() { MailManager mailManager = new MailManager(); Fax fax = new Fax(mailManager); mailManager.SimulateNewMail("Pavel", "Katya", "Hello, world!"); fax.Unregister(mailManager); }
public void Run() { MailManager mailManager = new MailManager(); Fax fax = new Fax(mailManager); mailManager.SimulateNewMail("Pavel", "Katya", "Hello, world!"); fax.Unregister(mailManager); }
public void Unregister(MailManager mailManager) { mailManager.NewMail -= FaxMessage; }
public Fax(MailManager mailManager) { mailManager.NewMail += FaxMessage; }
public void Unregister(MailManager mailManager) { mailManager.NewMail -= FaxMessage; }
public Fax(MailManager mailManager) { mailManager.NewMail += FaxMessage; }