2 using System
.Reflection
;
5 public virtual int vmethod () {
12 public override int vmethod () {
15 static int stuff (int a
) {
18 static int stuff (char a
) {
25 Type
[] char_types
= new Type
[1] {typeof(char)}
;
26 Type
[] int_types
= new Type
[1] {typeof(int)}
;
27 object[] int_args
= new object[1] {1}
;
28 object[] char_args
= new object[1] {(char)1}
;
32 m1
= t
.GetMethod ("stuff", BindingFlags
.Static
|BindingFlags
.NonPublic
);
33 } catch (AmbiguousMatchException
) {
39 m1
= t
.GetMethod ("stuff", BindingFlags
.Static
|BindingFlags
.NonPublic
,
40 null, char_types
, null);
41 Console
.WriteLine ("m1: {0}", m1
);
45 object m1res
= m1
.Invoke (null, char_args
);
46 Console
.WriteLine ("m1 invoke: {0}", m1res
);
52 m1res
= m1
.Invoke (null, int_args
);
53 } catch (ArgumentException
) {
59 m2
= b
.GetMethod ("vmethod");
60 Console
.WriteLine ("m2: {0}, declaring: {1}, reflected: {2}", m2
, m2
.DeclaringType
, m2
.ReflectedType
);
61 object m2res
= m2
.Invoke (obj
, null);