/tags/rel-1.3.35/Examples/test-suite/csharp/director_ignore_runme.cs
C# | 57 lines | 44 code | 10 blank | 3 comment | 4 complexity | baf82f289ff50e570cb3b31c3f08b2b4 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
1using System;
2
3namespace director_ignoreNamespace {
4
5public class runme
6{
7 static void Main()
8 {
9 runme r = new runme();
10 r.run();
11 }
12
13 void run()
14 {
15 // Just check the classes can be instantiated and other methods work as expected
16 DIgnoresDerived a = new DIgnoresDerived();
17 if (a.Triple(5) != 15)
18 throw new Exception("Triple failed");
19 DAbstractIgnoresDerived b = new DAbstractIgnoresDerived();
20 if (b.Quadruple(5) != 20)
21 throw new Exception("Quadruple failed");
22 }
23}
24
25class DIgnoresDerived : DIgnores
26{
27 public DIgnoresDerived() : base()
28 {
29 }
30
31 // These will give a warning if the %ignore is not working
32 public virtual int OverloadedMethod(int n, int xoffset, int yoffset) { return 0; }
33 public virtual int OverloadedMethod(int n, int xoffset) { return 0; }
34 public virtual int OverloadedMethod(int n) { return 0; }
35
36 public virtual int OverloadedProtectedMethod(int n, int xoffset, int yoffset) { return 0; }
37 public virtual int OverloadedProtectedMethod(int n, int xoffset) { return 0; }
38 public virtual int OverloadedProtectedMethod(int n) { return 0; }
39}
40
41class DAbstractIgnoresDerived : DAbstractIgnores
42{
43 public DAbstractIgnoresDerived() : base()
44 {
45 }
46
47 // These will give a warning if the %ignore is not working
48 public virtual int OverloadedMethod(int n, int xoffset, int yoffset) { return 0; }
49 public virtual int OverloadedMethod(int n, int xoffset) { return 0; }
50 public virtual int OverloadedMethod(int n) { return 0; }
51
52 public virtual int OverloadedProtectedMethod(int n, int xoffset, int yoffset) { return 0; }
53 public virtual int OverloadedProtectedMethod(int n, int xoffset) { return 0; }
54 public virtual int OverloadedProtectedMethod(int n) { return 0; }
55}
56
57}