예제 #1
0
        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);
            }
        }
예제 #2
0
 public BeepSubscriber(Publisher subject)
     : base(subject)
 {
 }
예제 #3
0
 public Subscriber(Publisher subject)
 {
     this.subject = subject;
     subject.fireEvent += new Publisher.FireAlarmHandler(Alarm);
 }
예제 #4
0
 public InstrctionSubscriber(Publisher subject)
     : base(subject)
 {
 }