142 lines
5.4 KiB
C#
142 lines
5.4 KiB
C#
using System;
|
|
using System.Globalization;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace System.Reflection
|
|
{
|
|
/// <summary>Represents a clause in a structured exception-handling block.</summary>
|
|
// Token: 0x0200023F RID: 575
|
|
[ComVisible(true)]
|
|
public sealed class ExceptionHandlingClause
|
|
{
|
|
// Token: 0x06001E0D RID: 7693 RVA: 0x0007062C File Offset: 0x0006E82C
|
|
internal ExceptionHandlingClause()
|
|
{
|
|
}
|
|
|
|
/// <summary>Gets the type of exception handled by this clause.</summary>
|
|
/// <returns>A <see cref="T:System.Type" /> object that represents that type of exception handled by this clause, or null if the <see cref="P:System.Reflection.ExceptionHandlingClause.Flags" /> property is <see cref="F:System.Reflection.ExceptionHandlingClauseOptions.Filter" /> or <see cref="F:System.Reflection.ExceptionHandlingClauseOptions.Finally" />.</returns>
|
|
/// <exception cref="T:System.InvalidOperationException">Invalid use of property for the object's current state.</exception>
|
|
// Token: 0x1700056A RID: 1386
|
|
// (get) Token: 0x06001E0E RID: 7694 RVA: 0x00070634 File Offset: 0x0006E834
|
|
public Type CatchType
|
|
{
|
|
get
|
|
{
|
|
return this.catch_type;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets the offset within the method body, in bytes, of the user-supplied filter code.</summary>
|
|
/// <returns>The offset within the method body, in bytes, of the user-supplied filter code. The value of this property has no meaning if the <see cref="P:System.Reflection.ExceptionHandlingClause.Flags" /> property has any value other than <see cref="F:System.Reflection.ExceptionHandlingClauseOptions.Filter" />.</returns>
|
|
/// <exception cref="T:System.InvalidOperationException">Cannot get the offset because the exception handling clause is not a filter.</exception>
|
|
// Token: 0x1700056B RID: 1387
|
|
// (get) Token: 0x06001E0F RID: 7695 RVA: 0x0007063C File Offset: 0x0006E83C
|
|
public int FilterOffset
|
|
{
|
|
get
|
|
{
|
|
return this.filter_offset;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets a value indicating whether this exception-handling clause is a finally clause, a type-filtered clause, or a user-filtered clause.</summary>
|
|
/// <returns>An <see cref="T:System.Reflection.ExceptionHandlingClauseOptions" /> value that indicates what kind of action this clause performs.</returns>
|
|
// Token: 0x1700056C RID: 1388
|
|
// (get) Token: 0x06001E10 RID: 7696 RVA: 0x00070644 File Offset: 0x0006E844
|
|
public ExceptionHandlingClauseOptions Flags
|
|
{
|
|
get
|
|
{
|
|
return this.flags;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets the length, in bytes, of the body of this exception-handling clause.</summary>
|
|
/// <returns>An integer that represents the length, in bytes, of the MSIL that forms the body of this exception-handling clause.</returns>
|
|
// Token: 0x1700056D RID: 1389
|
|
// (get) Token: 0x06001E11 RID: 7697 RVA: 0x0007064C File Offset: 0x0006E84C
|
|
public int HandlerLength
|
|
{
|
|
get
|
|
{
|
|
return this.handler_length;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets the offset within the method body, in bytes, of this exception-handling clause.</summary>
|
|
/// <returns>An integer that represents the offset within the method body, in bytes, of this exception-handling clause.</returns>
|
|
// Token: 0x1700056E RID: 1390
|
|
// (get) Token: 0x06001E12 RID: 7698 RVA: 0x00070654 File Offset: 0x0006E854
|
|
public int HandlerOffset
|
|
{
|
|
get
|
|
{
|
|
return this.handler_offset;
|
|
}
|
|
}
|
|
|
|
/// <summary>The total length, in bytes, of the try block that includes this exception-handling clause.</summary>
|
|
/// <returns>The total length, in bytes, of the try block that includes this exception-handling clause.</returns>
|
|
// Token: 0x1700056F RID: 1391
|
|
// (get) Token: 0x06001E13 RID: 7699 RVA: 0x0007065C File Offset: 0x0006E85C
|
|
public int TryLength
|
|
{
|
|
get
|
|
{
|
|
return this.try_length;
|
|
}
|
|
}
|
|
|
|
/// <summary>The offset within the method, in bytes, of the try block that includes this exception-handling clause.</summary>
|
|
/// <returns>An integer that represents the offset within the method, in bytes, of the try block that includes this exception-handling clause.</returns>
|
|
// Token: 0x17000570 RID: 1392
|
|
// (get) Token: 0x06001E14 RID: 7700 RVA: 0x00070664 File Offset: 0x0006E864
|
|
public int TryOffset
|
|
{
|
|
get
|
|
{
|
|
return this.try_offset;
|
|
}
|
|
}
|
|
|
|
/// <summary>A string representation of the exception-handling clause.</summary>
|
|
/// <returns>A string that lists appropriate property values for the filter clause type.</returns>
|
|
// Token: 0x06001E15 RID: 7701 RVA: 0x0007066C File Offset: 0x0006E86C
|
|
public override string ToString()
|
|
{
|
|
string text = string.Format("Flags={0}, TryOffset={1}, TryLength={2}, HandlerOffset={3}, HandlerLength={4}", new object[] { this.flags, this.try_offset, this.try_length, this.handler_offset, this.handler_length });
|
|
if (this.catch_type != null)
|
|
{
|
|
text = string.Format("{0}, CatchType={1}", text, this.catch_type);
|
|
}
|
|
if (this.flags == ExceptionHandlingClauseOptions.Filter)
|
|
{
|
|
text = string.Format(CultureInfo.InvariantCulture, "{0}, FilterOffset={1}", new object[] { text, this.filter_offset });
|
|
}
|
|
return text;
|
|
}
|
|
|
|
// Token: 0x04000A2E RID: 2606
|
|
internal Type catch_type;
|
|
|
|
// Token: 0x04000A2F RID: 2607
|
|
internal int filter_offset;
|
|
|
|
// Token: 0x04000A30 RID: 2608
|
|
internal ExceptionHandlingClauseOptions flags;
|
|
|
|
// Token: 0x04000A31 RID: 2609
|
|
internal int try_offset;
|
|
|
|
// Token: 0x04000A32 RID: 2610
|
|
internal int try_length;
|
|
|
|
// Token: 0x04000A33 RID: 2611
|
|
internal int handler_offset;
|
|
|
|
// Token: 0x04000A34 RID: 2612
|
|
internal int handler_length;
|
|
}
|
|
}
|