예제 #1
0
        static void Main(string[] args)
        {
            Subject_Provider subject = new Subject_Provider();

            subject.NotifyObservers(5);


            Console.WriteLine('\n' + "Press ESC to stop");
            do
            {
                while (!Console.KeyAvailable)
                {
                }
            } while (Console.ReadKey(true).Key != ConsoleKey.Escape);
        }
예제 #2
0
 public virtual void Subscribe(Subject_Provider provider)
 {
     cancellation = provider.AttachObserver(this);
 }