blob: dafe515a0a8c2951e53796ac287824e72d6a76a6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
using System;
using System.Reflection;
public delegate long MyDelegate ();
public interface X
{
event MyDelegate Foo;
int Prop { get; }
}
public class Y : X
{
event MyDelegate X.Foo {
add {
}
remove {
}
}
int X.Prop {
get { return 1; }
}
public event MyDelegate Foo;
public static int Main ()
{
MethodInfo o = typeof (Y).GetMethod ("X.add_Foo", BindingFlags.NonPublic | BindingFlags.Instance);
if (o == null)
return 1;
o = typeof (Y).GetMethod ("X.get_Prop", BindingFlags.NonPublic | BindingFlags.Instance);
if (o == null)
return 2;
Console.WriteLine ("OK");
return 0;
}
}
|