Beispiel #1
0
        static void Main(string[] args)
        {
            notifier not = SayHello;

            not("Pidor");

            not = SayGoodbye;
            not("Pidor");
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            String    name      = Console.ReadLine();
            Delegates delegates = new Delegates();
            notifier  notifier1 = delegates.SayHello;

            notifier1(name);
            notifier notifier2 = delegates.SayGoodbye;

            notifier2(name);
            notifier1 += delegates.SayGoodbye;
            notifier1(name);
        }