Beispiel #1
0
        static void Main(string[] args)
        {
            PublisherList pl       = new PublisherList();
            ListListener  listList = new ListListener();

            listList.Subscribe(pl);

            ListListenerSaveToFile listListSave = new ListListenerSaveToFile();

            listListSave.Subscribe(pl);

            pl.Add(1);
            pl.Add("witam");
            pl.Add(Math.PI);

            Thread.Sleep(1000);
            Console.WriteLine("\n");

            pl[0] = 2;

            pl.Clear();

            listListSave.Unsubscribe(pl);

            pl.Add("ostatnia wartosc");

            Thread.Sleep(10000);
        }
Beispiel #2
0
 public void Unsubscribe(PublisherList pl)
 {
     pl.ChangeDetected -= new PublisherList.ChangeDetectedHandler(SthHasChanged);
 }