IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
ExceptionHandlingClause.cs
Go to the documentation of this file.
1/*
2 Copyright (C) 2009 Jeroen Frijters
3
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.
7
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:
11
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.
19
20 Jeroen Frijters
21 jeroen@frijters.net
22
23*/
25
26namespace IKVM.Reflection
27{
28
29 internal sealed class ExceptionHandlingClause
30 {
31
32 readonly int flags;
33 readonly int tryOffset;
34 readonly int tryLength;
35 readonly int handlerOffset;
36 readonly int handlerLength;
37 readonly Type catchType;
38 readonly int filterOffset;
39
51 internal ExceptionHandlingClause(ModuleReader module, int flags, int tryOffset, int tryLength, int handlerOffset, int handlerLength, int classTokenOrfilterOffset, IGenericContext context)
52 {
53 this.flags = flags;
54 this.tryOffset = tryOffset;
55 this.tryLength = tryLength;
56 this.handlerOffset = handlerOffset;
57 this.handlerLength = handlerLength;
58 this.catchType = flags == (int)ExceptionHandlingClauseOptions.Clause && classTokenOrfilterOffset != 0 ? module.ResolveType(classTokenOrfilterOffset, context) : null;
59 this.filterOffset = flags == (int)ExceptionHandlingClauseOptions.Filter ? classTokenOrfilterOffset : 0;
60 }
61
62 public Type CatchType
63 {
64 get { return catchType; }
65 }
66
67 public int FilterOffset
68 {
69 get { return filterOffset; }
70 }
71
72 public ExceptionHandlingClauseOptions Flags
73 {
74 get { return (ExceptionHandlingClauseOptions)flags; }
75 }
76
77 public int HandlerLength
78 {
79 get { return handlerLength; }
80 }
81
82 public int HandlerOffset
83 {
84 get { return handlerOffset; }
85 }
86
87 public int TryLength
88 {
89 get { return tryLength; }
90 }
91
92 public int TryOffset
93 {
94 get { return tryOffset; }
95 }
96
97 }
98
99}
IKVM.Reflection.Type Type