PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/Mono.Cecil.Cil/ExceptionHandler.cs

http://github.com/jbevain/cecil
C# | 71 lines | 49 code | 13 blank | 9 comment | 0 complexity | 8a25e877702875c5a29260a755b44973 MD5 | raw file
 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
11namespace Mono.Cecil.Cil {
12
13	public enum ExceptionHandlerType {
14		Catch = 0,
15		Filter = 1,
16		Finally = 2,
17		Fault = 4,
18	}
19
20	public sealed class ExceptionHandler {
21
22		Instruction try_start;
23		Instruction try_end;
24		Instruction filter_start;
25		Instruction handler_start;
26		Instruction handler_end;
27
28		TypeReference catch_type;
29		ExceptionHandlerType handler_type;
30
31		public Instruction TryStart {
32			get { return try_start; }
33			set { try_start = value; }
34		}
35
36		public Instruction TryEnd {
37			get { return try_end; }
38			set { try_end = value; }
39		}
40
41		public Instruction FilterStart {
42			get { return filter_start; }
43			set { filter_start = value; }
44		}
45
46		public Instruction HandlerStart {
47			get { return handler_start; }
48			set { handler_start = value; }
49		}
50
51		public Instruction HandlerEnd {
52			get { return handler_end; }
53			set { handler_end = value; }
54		}
55
56		public TypeReference CatchType {
57			get { return catch_type; }
58			set { catch_type = value; }
59		}
60
61		public ExceptionHandlerType HandlerType {
62			get { return handler_type; }
63			set { handler_type = value; }
64		}
65
66		public ExceptionHandler (ExceptionHandlerType handlerType)
67		{
68			this.handler_type = handlerType;
69		}
70	}
71}