2 // Mono.ILASM.HandlerBlock
5 // Jackson Harper (Jackson@LatitudeGeo.com)
7 // (C) 2003 Jackson Harper (Jackson@LatitudeGeo.com)
13 namespace Mono.ILASM {
15 public class HandlerBlock {
24 private string from_label;
25 private string to_label;
28 private int from_offset;
29 private int to_offset;
31 public HandlerBlock (string from_label, string to_label)
33 this.from_label = from_label;
34 this.to_label = to_label;
38 public HandlerBlock (int from_pos, int to_pos)
40 this.from_pos = from_pos;
45 public HandlerBlock (int from_offset, int to_offset, bool place_holder)
47 this.from_offset = from_offset;
48 this.to_offset = to_offset;
52 public PEAPI.CILLabel GetFromLabel (CodeGen code_gen, MethodDef method)
56 return method.GetLabelDef (from_label);
58 return method.GetLabelDef (from_pos);
60 return method.GetLabelDef ((uint) from_offset);
62 throw new Exception ("Should not reach this point.");
66 public PEAPI.CILLabel GetToLabel (CodeGen code_gen, MethodDef method)
70 return method.GetLabelDef (to_label);
72 return method.GetLabelDef (to_pos);
74 return method.GetLabelDef ((uint) to_offset);
76 throw new Exception ("Should not reach this point.");