PageRenderTime 43ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/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
  1. using System;
  2. namespace director_ignoreNamespace {
  3. public class runme
  4. {
  5. static void Main()
  6. {
  7. runme r = new runme();
  8. r.run();
  9. }
  10. void run()
  11. {
  12. // Just check the classes can be instantiated and other methods work as expected
  13. DIgnoresDerived a = new DIgnoresDerived();
  14. if (a.Triple(5) != 15)
  15. throw new Exception("Triple failed");
  16. DAbstractIgnoresDerived b = new DAbstractIgnoresDerived();
  17. if (b.Quadruple(5) != 20)
  18. throw new Exception("Quadruple failed");
  19. }
  20. }
  21. class DIgnoresDerived : DIgnores
  22. {
  23. public DIgnoresDerived() : base()
  24. {
  25. }
  26. // These will give a warning if the %ignore is not working
  27. public virtual int OverloadedMethod(int n, int xoffset, int yoffset) { return 0; }
  28. public virtual int OverloadedMethod(int n, int xoffset) { return 0; }
  29. public virtual int OverloadedMethod(int n) { return 0; }
  30. public virtual int OverloadedProtectedMethod(int n, int xoffset, int yoffset) { return 0; }
  31. public virtual int OverloadedProtectedMethod(int n, int xoffset) { return 0; }
  32. public virtual int OverloadedProtectedMethod(int n) { return 0; }
  33. }
  34. class DAbstractIgnoresDerived : DAbstractIgnores
  35. {
  36. public DAbstractIgnoresDerived() : base()
  37. {
  38. }
  39. // These will give a warning if the %ignore is not working
  40. public virtual int OverloadedMethod(int n, int xoffset, int yoffset) { return 0; }
  41. public virtual int OverloadedMethod(int n, int xoffset) { return 0; }
  42. public virtual int OverloadedMethod(int n) { return 0; }
  43. public virtual int OverloadedProtectedMethod(int n, int xoffset, int yoffset) { return 0; }
  44. public virtual int OverloadedProtectedMethod(int n, int xoffset) { return 0; }
  45. public virtual int OverloadedProtectedMethod(int n) { return 0; }
  46. }
  47. }