blob: c3e65ca072828b27e8e120cf2916d834595c3758 (
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
43
44
45
|
using System;
public abstract class A
{
public abstract event EventHandler Finished;
public int count;
public A ()
{
}
public void test (A a)
{
a.Finished += TestA;
}
public void TestA (object sender, EventArgs e)
{
Console.WriteLine ("A test method.");
count += 3;
}
}
public class B : A
{
public override event EventHandler Finished;
public B ()
{
Finished += this.TestB;
this.test (this);
Finished (this, EventArgs.Empty);
}
public void TestB (object sender, EventArgs e)
{
Console.WriteLine ("B test method.");
count += 7;
}
public static int Main ()
{
return new B ().count - 10;
}
}
|