Beispiel #1
0
        static void Main(string[] args)
        {
            Subject   subject = new Subject();
            IObserver display = new Display();
            IObserver dips1   = new DisplayNew();

            subject.RegisterObserver(dips1);
            subject.RegisterObserver(display);

            subject.SetMeasurement((float)10.2, (float)11.2, (float)13.2);

            subject.RemoveObserver(display);

            subject.SetMeasurement((float)7.2, (float)8.2, (float)9.2);
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Subject subject = new Subject();
            IObserver display = new Display();
            IObserver dips1 = new DisplayNew();
            subject.RegisterObserver(dips1);
            subject.RegisterObserver(display);

            subject.SetMeasurement((float)10.2, (float)11.2, (float)13.2);

            subject.RemoveObserver(display);

            subject.SetMeasurement((float)7.2, (float)8.2, (float)9.2);
        }