static void Main(string[] args)
        {
            TempObservable source = new TempObservable();

            MyObserver observer1 = new MyObserver("Marcin");

            using (IDisposable subsciption = source.Subscribe(observer1))
            {
            }
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            MySubject  Subj = new MySubject();
            MyObserver obs1 = new MyObserver();
            MyObserver obs2 = new MyObserver();

            Subj.registerObserver(obs1);
            Subj.registerObserver(obs2);
            Subj.ChangeI(3);
            Subj.removeObserver(obs2);
            Subj.ChangeI(5);
            Console.ReadKey();
        }