Example #1
0
        public static void AltaMetoda()
        {
            AbstractObserver afisaj = new Afisaj2();
            //MeteoStation.Instance.Run();
            var             del = new ExamplesEventsAndDelegates();
            AndreisDelegate ad1 = del.RunMultipleTimes;
            AndreisDelegate ad2 = AfisareNumar;

            Bum += ad1;
            Bum += ad2;
            ad1(2);
            ad2(4);
            ad2.Invoke(8);
            var i = 0;

            while (i < 3)
            {
                Console.WriteLine("introdu ceva");
                var ceva = Console.ReadLine();
                if (ceva == "Bum")
                {
                    if (Bum != null)
                    {
                        Bum.Invoke(i);
                    }
                    Console.WriteLine("Am invocat Bum ({0})", i);
                    i++;
                }
            }
            Console.WriteLine("gata while-ul");
        }
Example #2
0
 public void Attach(AndreisDelegate toDoWhen)
 {
     TempChange += toDoWhen;
 }