4 public class MyObject
: DynamicObject
6 public static int Get
, Invoke
;
8 public override bool TryGetMember (GetMemberBinder binder
, out object result
)
10 Console
.WriteLine ("Get");
16 public override bool TryInvokeMember (InvokeMemberBinder binder
, object[] args
, out object result
)
18 Console
.WriteLine ("Invoke");
27 public static int Main ()
29 dynamic d
= new MyObject ();
32 if (MyObject
.Get
!= 1 && MyObject
.Invoke
!= 0)
35 d
.printf ("Hello, World!");
36 if (MyObject
.Get
!= 1 && MyObject
.Invoke
!= 1)
39 Console
.WriteLine ("ok");