Esempio n. 1
0
        static void Main(string[] args)
        {
            printString ps1 = new printString(WriteToScreen);
            printString ps2 = new printString(WriteToFile);
            sendString(ps1);
            sendString(ps2);

            Console.ReadKey();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            printString ps1 = new printString(WriteToScreen);
            printString ps2 = new printString(WriteToFile);

            ps1("Hello World");
            ps2("Hello World");

            Console.ReadKey();
        }
Esempio n. 3
0
 // this method takes the delegate as parameter and uses it to
 // call the methods as required
 public static void sendString(printString ps)
 {
     ps("Hello World");
 }