public static void Main () {
        // This works:
        HelloPrinter printer = new HelloPrinter();
        ActionCaller.Call(printer.Print);

        // This doesn't:
        ActionCaller.Call(((IHelloPrinter)printer).Print);
    }
Exemple #2
0
    public static void Main()
    {
        // This works:
        HelloPrinter printer = new HelloPrinter();

        ActionCaller.Call(printer.Print);

        // This doesn't:
        ActionCaller.Call(((IHelloPrinter)printer).Print);
    }
 static void Main(string[] args)
 {
     HelloPrinter.Print();
 }