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-10-17 13:21:11 +0400
committerRavi Pratap M <ravi@mono-cvs.ximian.com>2001-10-17 13:21:11 +0400
commit0aeccb113031fc26650dd11cf37135c7f29359e6 (patch)
tree0509c2cbae0b34fbb33114753d4711177ff34626 /mcs/tests/test-26.cs
parent8192342a2b017f4cfc7adcce6170981bc12d3f7e (diff)
2001-10-17 Ravi Pratap <ravi@ximian.com>
* test-26.cs : Added to demonstrate delegate support. svn path=/trunk/mcs/; revision=1174
Diffstat (limited to 'mcs/tests/test-26.cs')
-rw-r--r--mcs/tests/test-26.cs27
1 files changed, 27 insertions, 0 deletions
diff --git a/mcs/tests/test-26.cs b/mcs/tests/test-26.cs
new file mode 100644
index 00000000000..4ca78b28664
--- /dev/null
+++ b/mcs/tests/test-26.cs
@@ -0,0 +1,27 @@
+using System;
+
+public class Blah {
+
+ public delegate int MyDelegate (int i, int j);
+
+ public int Foo (int i, int j)
+ {
+ return i+j;
+ }
+
+ public static int Main ()
+ {
+ Blah i = new Blah ();
+
+ MyDelegate del = new MyDelegate (i.Foo);
+
+ int number = del (2, 3);
+
+ if (number == 5)
+ return 0;
+ else
+ return 1;
+
+ }
+
+}