Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRavi Pratap M <ravi@mono-cvs.ximian.com>2001-12-24 09:34:03 +0300
committerRavi Pratap M <ravi@mono-cvs.ximian.com>2001-12-24 09:34:03 +0300
commitfa55a93ba52d92d34aef8f9f0107dc00b7a3bbe3 (patch)
tree0217e9ffff810c335ac37a5cf07b83d98a3ea61f /mcs/tests/test-57.cs
parentc72c27994e7c834f11f129fb13e5bb828d07fb4d (diff)
2001-12-24 Ravi Pratap <ravi@ximian.com>
* test-19.cs : Augment to exercise tests on delegates defined in mscorlib. * test-57.cs : Update to exercise the -= operator as well. svn path=/trunk/mcs/; revision=1706
Diffstat (limited to 'mcs/tests/test-57.cs')
-rw-r--r--mcs/tests/test-57.cs15
1 files changed, 11 insertions, 4 deletions
diff --git a/mcs/tests/test-57.cs b/mcs/tests/test-57.cs
index fead8b0ad2f..9c88245e5bb 100644
--- a/mcs/tests/test-57.cs
+++ b/mcs/tests/test-57.cs
@@ -8,8 +8,12 @@ public class Button {
public void OnClick (int i, int j)
{
- if (Click != null)
- Click (i, j);
+ if (Click == null) {
+ Console.WriteLine ("Nothing to click!");
+ return;
+ }
+
+ Click (i, j);
}
public void Reset ()
@@ -36,7 +40,7 @@ public class Blah {
public void Disconnect ()
{
Console.WriteLine ("Disconnecting ...");
- // Button1.Click -= new EventHandler (Button1_Click);
+ Button1.Click -= new EventHandler (Button1_Click);
}
public static int Main ()
@@ -47,7 +51,10 @@ public class Blah {
b.Button1.OnClick (2, 3);
- b.OnClick ();
+ b.Disconnect ();
+
+ Console.WriteLine ("Now calling OnClick again");
+ b.Button1.OnClick (3, 7);
Console.WriteLine ("Events test passes");
return 0;