The Labs \ Source Viewer \ SSCLI \ System.Runtime.InteropServices \ SEHException

  1. // ==++==
  2. //
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. //
  14. // ==--==
  15. /*=============================================================================
  16. **
  17. ** Class: SEHException
  18. **
  19. **
  20. ** Purpose: Exception class for all Structured Exception Handling code.
  21. **
  22. **
  23. =============================================================================*/
  24. namespace System.Runtime.InteropServices
  25. {
  26.     using System.Runtime.InteropServices;
  27.     using System;
  28.     using System.Runtime.Serialization;
  29.     // Exception for Structured Exception Handler exceptions.
  30.     //
  31.     [System.Runtime.InteropServices.ComVisible(true)]
  32.     [Serializable()]
  33.     public class SEHException : ExternalException
  34.     {
  35.         public SEHException() : base()
  36.         {
  37.             SetErrorCode(__HResults.E_FAIL);
  38.         }
  39.        
  40.         public SEHException(string message) : base(message)
  41.         {
  42.             SetErrorCode(__HResults.E_FAIL);
  43.         }
  44.        
  45.         public SEHException(string message, Exception inner) : base(message, inner)
  46.         {
  47.             SetErrorCode(__HResults.E_FAIL);
  48.         }
  49.        
  50.         protected SEHException(SerializationInfo info, StreamingContext context) : base(info, context)
  51.         {
  52.         }
  53.        
  54.         // Exceptions can be resumable, meaning a filtered exception
  55.         // handler can correct the problem that caused the exception,
  56.         // and the code will continue from the point that threw the
  57.         // exception.
  58.         //
  59.         // Resumable exceptions aren't implemented in this version,
  60.         // but this method exists and always returns false.
  61.         //
  62.         public virtual bool CanResume()
  63.         {
  64.             return false;
  65.         }
  66.     }
  67. }

Developer Fusion