The Labs \ Source Viewer \ SSCLI \ System \ ArithmeticException

  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: ArithmeticException
  18. **
  19. **
  20. ** Purpose: Exception class for bad arithmetic conditions!
  21. **
  22. **
  23. =============================================================================*/
  24. namespace System
  25. {
  26.    
  27.     using System;
  28.     using System.Runtime.Serialization;
  29.     // The ArithmeticException is thrown when overflow or underflow
  30.     // occurs.
  31.     //
  32.     [System.Runtime.InteropServices.ComVisible(true)]
  33.     [Serializable()]
  34.     public class ArithmeticException : SystemException
  35.     {
  36.         // Creates a new ArithmeticException with its message string set to
  37.         // the empty string, its HRESULT set to COR_E_ARITHMETIC,
  38.         // and its ExceptionInfo reference set to null.
  39.         public ArithmeticException() : base(Environment.GetResourceString("Arg_ArithmeticException"))
  40.         {
  41.             SetErrorCode(__HResults.COR_E_ARITHMETIC);
  42.         }
  43.        
  44.         // Creates a new ArithmeticException with its message string set to
  45.         // message, its HRESULT set to COR_E_ARITHMETIC,
  46.         // and its ExceptionInfo reference set to null.
  47.         //
  48.         public ArithmeticException(string message) : base(message)
  49.         {
  50.             SetErrorCode(__HResults.COR_E_ARITHMETIC);
  51.         }
  52.        
  53.         public ArithmeticException(string message, Exception innerException) : base(message, innerException)
  54.         {
  55.             SetErrorCode(__HResults.COR_E_ARITHMETIC);
  56.         }
  57.        
  58.         protected ArithmeticException(SerializationInfo info, StreamingContext context) : base(info, context)
  59.         {
  60.         }
  61.        
  62.     }
  63.    
  64. }

Developer Fusion