private void btnAlarm_Click(object sender, EventArgs e) { Publisher publisher = new Publisher(); BeepSubscriber derek = new BeepSubscriber(publisher); InstrctionSubscriber sean = new InstrctionSubscriber(publisher); if(rdobtnMinor.Checked) { publisher.OnfirmEvent(EFires.Minor); } if(rdobtnSerious.Checked) { publisher.OnfirmEvent(EFires.Serious); } if(rdobtnInferno.Checked) { publisher.OnfirmEvent(EFires.Inferno); } }
public BeepSubscriber(Publisher subject) : base(subject) { }
public Subscriber(Publisher subject) { this.subject = subject; subject.fireEvent += new Publisher.FireAlarmHandler(Alarm); }
public InstrctionSubscriber(Publisher subject) : base(subject) { }