etmar Maurer <dietmar@ximian.com>
[mono.git] / mono / tests / delegate4.cs
1 using System;
2 using System.Threading;
3 using System.Runtime.InteropServices;
4 using System.Runtime.Remoting.Messaging;
5
6 class Test {
7         public delegate int SimpleDelegate (int a, int b);
8
9         [DllImport ("libtest.so", EntryPoint="mono_invoke_delegate")]
10         static extern int mono_invoke_delegate (SimpleDelegate d);
11
12         public static int Add (int a, int b) {
13                 Console.WriteLine ("Test.Add from delegate: " + a +  "+ " + b);
14                 return a + b;
15         }
16
17         static int Main () {
18                 SimpleDelegate d = new SimpleDelegate (Add);
19                 
20                 mono_invoke_delegate (d);
21
22                 return 0;
23         }
24 }