2009-03-11 Zoltan Varga <vargaz@gmail.com>
[mono-debugger.git] / mono / tests / runtime-invoke.cs
blob7ffaf16ee4f01fba386ae5a13dc067466b336edc
1 using System;
2 using System.Reflection;
4 public struct A
6 public override string ToString ()
8 return "A";
12 public class D
14 public string Test ()
16 return "Test";
20 class X
22 static void Main ()
24 Assembly ass = Assembly.GetCallingAssembly ();
25 Type a_type = ass.GetType ("A");
26 MethodInfo a_method = a_type.GetMethod ("ToString");
28 Type d_type = ass.GetType ("D");
29 MethodInfo d_method = d_type.GetMethod ("Test");
31 Console.WriteLine ("TEST: {0} {1}", a_method, d_method);
33 A a = new A ();
34 D d = new D ();
36 object a_ret = a_method.Invoke (a, null);
37 Console.WriteLine (a_ret);
39 object d_ret = d_method.Invoke (d, null);
40 Console.WriteLine (d_ret);