[tuner] handle the case with multiple "preserve" attributes
[mono-project.git] / mcs / tests / test-anon-17.cs
blob133f38258e37cbc56abf9371eff272210a1dc00e
1 //
2 // Tests the syntax for delegates and events
3 //
4 using System;
6 delegate void ClickEvent ();
8 class Button {
9 public event ClickEvent Clicked;
11 public void DoClick ()
13 Clicked ();
18 class X {
19 static bool called = false;
21 public static int Main ()
23 Button b = new Button ();
25 b.Clicked += delegate {
26 Console.WriteLine ("This worked!");
27 called = true;
30 b.DoClick ();
32 if (called)
33 return 0;
34 else
35 return 1;