Exemple #1
0
        public static void Main(string[] args)
        {
            IvanSubject ivan = new IvanSubject();

            ivan.Age = 10;
            IvanObserver ivanObs = new IvanObserver("ivan_observer", ivan);

            ivan.Attach(ivanObs);
            ivan.Age = 11;
            Console.ReadKey();
        }
Exemple #2
0
 public static void Main(string[] args)
 {
     IvanSubject ivan = new IvanSubject();
     ivan.Age = 10;
     IvanObserver ivanObs = new IvanObserver("ivan_observer", ivan);
     ivan.Attach(ivanObs);
     ivan.Age = 11;
     Console.ReadKey();
 }
Exemple #3
0
 public IvanObserver(string name, IvanSubject subj)
 {
     this.name = name;
     this.subj = subj;
 }
Exemple #4
0
 public IvanObserver(string name, IvanSubject subj)
 {
     this.name = name;
     this.subj = subj;
 }