9 internal readonly
int m_exceptionClass;
11 internal readonly
int m_tryStartOffset;
13 internal readonly
int m_tryEndOffset;
15 internal readonly
int m_filterOffset;
17 internal readonly
int m_handlerStartOffset;
19 internal readonly
int m_handlerEndOffset;
33 public int TryLength => m_tryEndOffset - m_tryStartOffset;
75 if (handlerOffset < 0)
79 if (handlerLength < 0)
83 if ((
long)tryOffset + (long)tryLength >
int.MaxValue)
87 if ((
long)handlerOffset + (long)handlerLength >
int.MaxValue)
95 if (!IsValidKind(kind))
99 m_tryStartOffset = tryOffset;
100 m_tryEndOffset = tryOffset + tryLength;
101 m_filterOffset = filterOffset;
102 m_handlerStartOffset = handlerOffset;
103 m_handlerEndOffset = handlerOffset + handlerLength;
105 m_exceptionClass = exceptionTypeToken;
108 internal ExceptionHandler(
int tryStartOffset,
int tryEndOffset,
int filterOffset,
int handlerStartOffset,
int handlerEndOffset,
int kind,
int exceptionTypeToken)
110 m_tryStartOffset = tryStartOffset;
111 m_tryEndOffset = tryEndOffset;
112 m_filterOffset = filterOffset;
113 m_handlerStartOffset = handlerStartOffset;
114 m_handlerEndOffset = handlerEndOffset;
116 m_exceptionClass = exceptionTypeToken;
137 return m_exceptionClass ^ m_tryStartOffset ^ m_tryEndOffset ^ m_filterOffset ^ m_handlerStartOffset ^ m_handlerEndOffset ^ (int)m_kind;
159 if (other.m_exceptionClass == m_exceptionClass && other.m_tryStartOffset == m_tryStartOffset && other.m_tryEndOffset == m_tryEndOffset && other.m_filterOffset == m_filterOffset && other.m_handlerStartOffset == m_handlerStartOffset && other.m_handlerEndOffset == m_handlerEndOffset)
161 return other.m_kind == m_kind;
173 return left.
Equals(right);
183 return !left.
Equals(right);
static bool operator==(ExceptionHandler left, ExceptionHandler right)
Determines whether two specified instances of T:System.Reflection.Emit.ExceptionHandler are equal.
override bool Equals(object obj)
Indicates whether this instance of the T:System.Reflection.Emit.ExceptionHandler object is equal to a...
int FilterOffset
Gets the byte offset at which the filter code for the exception handler begins.
override int GetHashCode()
Serves as the default hash function.
The exception that is thrown when the value of an argument is outside the allowable range of values a...
int TryLength
Gets the length, in bytes, of the code protected by this exception handler.
int HandlerLength
Gets the length, in bytes, of the exception handler.
int HandlerOffset
Gets the byte offset of the first instruction of the exception handler.
Provides information about, and means to manipulate, the current environment and platform....
ExceptionHandler(int tryOffset, int tryLength, int filterOffset, int handlerOffset, int handlerLength, ExceptionHandlingClauseOptions kind, int exceptionTypeToken)
Initializes a new instance of the T:System.Reflection.Emit.ExceptionHandler class with the specified ...
ExceptionHandlingClauseOptions Kind
Gets a value that represents the kind of exception handler this object represents.
int ExceptionTypeToken
Gets the token of the exception type handled by this handler.
int TryOffset
Gets the byte offset at which the code that is protected by this exception handler begins.
static bool operator !=(ExceptionHandler left, ExceptionHandler right)
Determines whether two specified instances of T:System.Reflection.Emit.ExceptionHandler are not equal...
bool Equals(ExceptionHandler other)
Indicates whether this instance of the T:System.Reflection.Emit.ExceptionHandler object is equal to a...
The exception that is thrown when one of the arguments provided to a method is not valid.
Represents an exception handler in a byte array of IL to be passed to a method such as M:System....
Defines a generalized method that a value type or class implements to create a type-specific method f...
ExceptionHandlingClauseOptions
Identifies kinds of exception-handling clauses.