Example #1
0
        static void Main(string[] args)
        {
            SubjectClass subject = new SubjectClass();
            ObserverClass observer = new ObserverClass(subject);
            subject.Value1 = 10;
            subject.Value1 = 100;
            observer.List();
            Console.ReadLine();

        }
Example #2
0
 public ObserverClass(SubjectClass subject)
 {
     subject.ValueChanged += TheValueChanged;
 }