2
Copyright (C) 2009 Jeroen Frijters
4
This software is provided 'as-is', without any express or implied
5
warranty. In no event will the authors be held liable for any damages
6
arising from the use of this software.
8
Permission is granted to anyone to use this software for any purpose,
9
including commercial applications, and to alter it and redistribute it
10
freely, subject to the following restrictions:
12
1. The origin of this software must not be misrepresented; you must not
13
claim that you wrote the original software. If you use this software
14
in a product, an acknowledgment in the product documentation would be
15
appreciated but is not required.
16
2. Altered source versions must be plainly marked as such, and must not be
17
misrepresented as being the original software.
18
3. This notice may not be removed or altered from any source distribution.
25
using IKVM.Reflection.Reader;
27
namespace IKVM.Reflection
30
public enum ExceptionHandlingClauseOptions
38
public sealed class ExceptionHandlingClause
40
private readonly int flags;
41
private readonly int tryOffset;
42
private readonly int tryLength;
43
private readonly int handlerOffset;
44
private readonly int handlerLength;
45
private readonly Type catchType;
46
private readonly int filterOffset;
48
internal ExceptionHandlingClause(ModuleReader module, int flags, int tryOffset, int tryLength, int handlerOffset, int handlerLength, int classTokenOrfilterOffset, IGenericContext context)
51
this.tryOffset = tryOffset;
52
this.tryLength = tryLength;
53
this.handlerOffset = handlerOffset;
54
this.handlerLength = handlerLength;
55
this.catchType = flags == (int)ExceptionHandlingClauseOptions.Clause && classTokenOrfilterOffset != 0 ? module.ResolveType(classTokenOrfilterOffset, context) : null;
56
this.filterOffset = flags == (int)ExceptionHandlingClauseOptions.Filter ? classTokenOrfilterOffset : 0;
61
get { return catchType; }
64
public int FilterOffset
66
get { return filterOffset; }
69
public ExceptionHandlingClauseOptions Flags
71
get { return (ExceptionHandlingClauseOptions)flags; }
74
public int HandlerLength
76
get { return handlerLength; }
79
public int HandlerOffset
81
get { return handlerOffset; }
86
get { return tryLength; }
91
get { return tryOffset; }