ExceptionHandlingClause.cs 1.1 KB

12345678910111213141516171819202122232425262728
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT license.
  3. // See the LICENSE file in the project root for more information.
  4. using System.Globalization;
  5. namespace System.Reflection
  6. {
  7. public class ExceptionHandlingClause
  8. {
  9. protected ExceptionHandlingClause() { }
  10. public virtual ExceptionHandlingClauseOptions Flags => default;
  11. public virtual int TryOffset => 0;
  12. public virtual int TryLength => 0;
  13. public virtual int HandlerOffset => 0;
  14. public virtual int HandlerLength => 0;
  15. public virtual int FilterOffset => throw new InvalidOperationException(SR.Arg_EHClauseNotFilter);
  16. public virtual Type CatchType => null;
  17. public override string ToString()
  18. {
  19. return string.Format(CultureInfo.CurrentUICulture,
  20. "Flags={0}, TryOffset={1}, TryLength={2}, HandlerOffset={3}, HandlerLength={4}, CatchType={5}",
  21. Flags, TryOffset, TryLength, HandlerOffset, HandlerLength, CatchType);
  22. }
  23. }
  24. }