public FireAlarmObserver(FireAlarmSubject subject)
        {
            this.subject = subject;

            // Add the Fire Alarm Handler to the list of handlers for Subject.FireEvent
            subject.feHandler += new FireAlarmSubject.FireEventHandler(FireAlarmHandler);
        }
Exemple #2
0
 public Form1()
 {
     InitializeComponent();
     fireSubject = new FireAlarmSubject();
     new InstructionsObserver(fireSubject);
     new AlarmObserver(fireSubject);
 }
        public FireAlarmObserverBase(FireAlarmSubject subject)
        {
            this.subject = subject;

            FireAlarmSubject.FireEventHandler handler = new FireAlarmSubject.FireEventHandler(FireAlarmHandlerMethod);
            subject.FireEvent += handler;
        }
Exemple #4
0
 public Form1()
 {
     InitializeComponent();
     subject             = new FireAlarmSubject();
     instructionObserver = new FireInstructionsObserver(subject);
     toneObserver        = new FireToneObserver(subject);
 }
Exemple #5
0
 public Form1()
 {
     InitializeComponent();
     fireSubject = new FireAlarmSubject();
     new InstructionsObserver(fireSubject);
     new AlarmObserver(fireSubject);
 }
        public FireAlarmObserver(FireAlarmSubject subject)
        {
            this.subject = subject;

            // Add the Fire Alarm Handler to the list of handlers for Subject.FireEvent
            subject.feHandler += new FireAlarmSubject.FireEventHandler(FireAlarmHandler);
        }
Exemple #7
0
 public Form1()
 {
     InitializeComponent();
     rbMinor.Checked = true;
     fireAlarmSubject = new FireAlarmSubject();
     instructionsObserver = new InstructionsObserver(fireAlarmSubject);
     beepObserver = new BeepObserver(fireAlarmSubject);
 }
Exemple #8
0
 public Form1()
 {
     InitializeComponent();
     rbMinor.Checked      = true;
     fireAlarmSubject     = new FireAlarmSubject();
     instructionsObserver = new InstructionsObserver(fireAlarmSubject);
     beepObserver         = new BeepObserver(fireAlarmSubject);
 }
Exemple #9
0
        public Form1()
        {
            InitializeComponent();

            subject = new FireAlarmSubject();
            io = new InstructionsObserver(subject);
            bo = new BellObserver(subject);
        }
Exemple #10
0
        public FireAlarmObservers(FireAlarmSubject subject)
        {
            fireSubject = subject;

            FireAlarmEventHandler handler = new FireAlarmEventHandler(FireAlarmHandlerMethod);

            subject.FireEvent += handler;
        }
        public FireAlarmObservers(FireAlarmSubject subject)
        {
            fireSubject = subject;

            FireAlarmEventHandler handler = new FireAlarmEventHandler(FireAlarmHandlerMethod);

            subject.FireEvent += handler;
        }
Exemple #12
0
        public Form1()
        {
            InitializeComponent();

            //Instantiate objects
            fas = new FireAlarmSubject();
            io = new InstructionsObserver(fas);
        }
        public FireAlarmObserver(FireAlarmSubject subject)
        {
            this.subject = subject;

            FireAlarmSubject.FireEventHandler handler = new FireAlarmSubject.FireEventHandler(HandlerMethod);

            subject.FireEvent += handler;
        }
        //Ctor
        public FireAlarmObserverBase(FireAlarmSubject s)
        {
            subject = s;
            //Create an event handler
            FireAlarmSubject.FireEventHandler handler = new FireAlarmSubject.FireEventHandler(FireAlarmEventHandler);

            //Bind this subject's method to a event handler
            subject.FireEvent += handler;
        }
        public Form1()
        {
            InitializeComponent();

            // Instantiate them
            subject = new FireAlarmSubject();
            obI     = new InstructionObserver(subject);
            obB     = new BeepObserver(subject);
        }
        //Constructor
        public FireAlarmObserverBase(FireAlarmSubject sub)
        {
            this.sub = sub;

            FireAlarmSubject.FireEventHandler handler = new FireAlarmSubject.FireEventHandler(FireAlarmHandlerMethod);

            // Observer gets added to the subject
            sub.FireEvent += handler;
        }
Exemple #17
0
        public Form1()
        {
            InitializeComponent();

            subject = new FireAlarmSubject();

            //sets observers to subject (beep first then message)
            FireAlarmBeep    beepEvent    = new FireAlarmBeep(subject);
            FireAlarmMessage messageEvent = new FireAlarmMessage(subject);
        }
        public Form1()
        {
            InitializeComponent();

            subject = new FireAlarmSubject();

            //sets observers to subject (beep first then message)
            FireAlarmBeep beepEvent = new FireAlarmBeep(subject);
            FireAlarmMessage messageEvent = new FireAlarmMessage(subject);
        }
Exemple #19
0
        public Form1()
        {
            InitializeComponent();
            //Create subject
            FireAlarm = new FireAlarmSubject();

            //Create observer(s)
            InstructionsObserver observer1 = new InstructionsObserver(FireAlarm);
            BeepObserver observer2 = new BeepObserver(FireAlarm);
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="subject">Subject to observe</param>
        public FireAlarmObserverBase(FireAlarmSubject subject)
        {
            //Keep reference to subject
            this.subject = subject;
            //Create a new handler
            FireAlarmSubject.FireEventHandler handler = new FireAlarmSubject.FireEventHandler(FireAlarmHandlerMethod);

            //Register handler with subject
            subject.FireEvent += handler;
        }
 //Blank ctor
 public InstructionsObserver(FireAlarmSubject subject)
     : base(subject)
 {
 }
Exemple #22
0
 public FireAlarmBeep(FireAlarmSubject subject)
     : base(subject)
 {
 }
Exemple #23
0
 public FireAlarmMessage(FireAlarmSubject subject)
     : base(subject)
 {
 }
 public FireAlarmEventTip(FireAlarmSubject subject)
     : base(subject)
 {
 }
Exemple #25
0
 public AlarmObserver(FireAlarmSubject subject) : base(subject)
 {
 }
Exemple #26
0
 private void Form1_Load(object sender, EventArgs e)
 {
     subjectWithEvent = new FireAlarmSubject();
     beep             = new BeepObserver(subjectWithEvent);
     instruction      = new InstructionsObserver(subjectWithEvent);
 }
 //Constructor
 public BeepObserver(FireAlarmSubject sub) : base(sub)
 {
 }
 public FireToneObserver(FireAlarmSubject subject)
     : base(subject)
 {
 }
Exemple #29
0
 public InstructionsObserver(FireAlarmSubject subject) : base(subject)
 {
 }
 public FireAlarmBeep(FireAlarmSubject subject)
     : base(subject)
 {
 }
 public FireAlarmMessage(FireAlarmSubject subject)
     : base(subject)
 {
 }
 public BeepObserver(FireAlarmSubject subject)
     : base(subject)
 {
 }
 public FireToneObserver(FireAlarmSubject subject)
     : base(subject)
 {
 }