Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // OrtizOL - xCSw
- using System;
- using System.Dynamic;
- public class Avion : DynamicObject
- {
- public override bool TryInvokeMember(InvokeMemberBinder binder,
- object[] args, out object result)
- {
- Console.WriteLine("Método `{0}` ha sido invocado.", binder.Name);
- result = null;
- return true;
- }
- }
- public class AvionPrueba
- {
- public static void Main()
- {
- Console.WriteLine();
- dynamic avionDyn = new Avion();
- avionDyn.Despegar(); // Método `Despegar` ha sido invocado.
- avionDyn.Atterizar(); // Método `Aterrizar` ha sido invocado.
- Console.WriteLine();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement