invoke.cs 875 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using System;
  2. namespace Embed {
  3. class MyType {
  4. int val = 5;
  5. string str = "hello";
  6. MyType () {
  7. Console.WriteLine ("In ctor val is: {0}", val);
  8. Console.WriteLine ("In ctor str is: {0}", str);
  9. }
  10. MyType (int v, byte[] array) {
  11. Console.WriteLine ("In ctor (int, byte[]) got value: {0}, array len: {1}", v, array.Length);
  12. }
  13. void method () {
  14. Console.WriteLine ("In method val is {0}", val);
  15. Console.WriteLine ("In method str is: {0}", str);
  16. }
  17. int Value {
  18. get {
  19. return val;
  20. }
  21. }
  22. string Message {
  23. get {
  24. return str;
  25. }
  26. }
  27. void Values (ref int v, ref string s) {
  28. Console.WriteLine ("In Values () v is {0}", v);
  29. Console.WriteLine ("In Values () s is: {0}", s);
  30. v = val;
  31. s = str;
  32. }
  33. static void Fail () {
  34. throw new Exception ();
  35. }
  36. static void Main () {
  37. /* we do nothing here... */
  38. }
  39. }
  40. }