ExceptionHandler.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. //
  2. // Author:
  3. // Jb Evain (jbevain@gmail.com)
  4. //
  5. // Copyright (c) 2008 - 2015 Jb Evain
  6. // Copyright (c) 2008 - 2011 Novell, Inc.
  7. //
  8. // Licensed under the MIT/X11 license.
  9. //
  10. namespace ILRuntime.Mono.Cecil.Cil {
  11. public enum ExceptionHandlerType {
  12. Catch = 0,
  13. Filter = 1,
  14. Finally = 2,
  15. Fault = 4,
  16. }
  17. public sealed class ExceptionHandler {
  18. Instruction try_start;
  19. Instruction try_end;
  20. Instruction filter_start;
  21. Instruction handler_start;
  22. Instruction handler_end;
  23. TypeReference catch_type;
  24. ExceptionHandlerType handler_type;
  25. public Instruction TryStart {
  26. get { return try_start; }
  27. set { try_start = value; }
  28. }
  29. public Instruction TryEnd {
  30. get { return try_end; }
  31. set { try_end = value; }
  32. }
  33. public Instruction FilterStart {
  34. get { return filter_start; }
  35. set { filter_start = value; }
  36. }
  37. public Instruction HandlerStart {
  38. get { return handler_start; }
  39. set { handler_start = value; }
  40. }
  41. public Instruction HandlerEnd {
  42. get { return handler_end; }
  43. set { handler_end = value; }
  44. }
  45. public TypeReference CatchType {
  46. get { return catch_type; }
  47. set { catch_type = value; }
  48. }
  49. public ExceptionHandlerType HandlerType {
  50. get { return handler_type; }
  51. set { handler_type = value; }
  52. }
  53. public ExceptionHandler (ExceptionHandlerType handlerType)
  54. {
  55. this.handler_type = handlerType;
  56. }
  57. }
  58. }