blob: 9c9f5f1a9f5d18a6f8295cbfb756d837d779ce4e (
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
|
//
// A compilation test: accessing an event from a nested class.
// Bug 48710
//
using System;
public delegate void OnWhateverDelegate( string s );
class cls
{
public event OnWhateverDelegate OnWhatever;
class nestedcls
{
internal void CallParentDel( cls c, string s )
{
c.OnWhatever( s );
}
}
internal void CallMyDel( string s)
{
(new nestedcls()).CallParentDel( this, s );
}
}
class MonoEmbed
{
public static void Main()
{
cls c = new cls();
c.OnWhatever += new OnWhateverDelegate( Whatever );
c.CallMyDel( "test" );
}
static void Whatever( string s )
{
Console.WriteLine( s );
}
}
|