Advertisement
Fhernd

Avion.cs

Jul 5th, 2015
1,100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.72 KB | None | 0 0
  1. // OrtizOL - xCSw
  2.  
  3. using System;
  4. using System.Dynamic;
  5.  
  6. public class Avion : DynamicObject
  7. {
  8.     public override bool TryInvokeMember(InvokeMemberBinder binder,
  9.                                          object[] args, out object result)
  10.     {
  11.         Console.WriteLine("Método `{0}` ha sido invocado.", binder.Name);
  12.         result = null;
  13.         return true;
  14.     }
  15. }
  16.  
  17. public class AvionPrueba
  18. {
  19.     public static void Main()
  20.     {
  21.         Console.WriteLine();
  22.        
  23.         dynamic avionDyn = new Avion();
  24.        
  25.         avionDyn.Despegar();    // Método `Despegar` ha sido invocado.
  26.         avionDyn.Atterizar();    // Método `Aterrizar` ha sido invocado.
  27.        
  28.         Console.WriteLine();
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement