mscorlib(4.0.0.0) API with additions
NotFiniteNumberException.cs
3 using System.Security;
4 
5 namespace System
6 {
9  [ComVisible(true)]
11  {
12  private double _offendingNumber;
13 
16  public double OffendingNumber => _offendingNumber;
17 
20  : base(Environment.GetResourceString("Arg_NotFiniteNumberException"))
21  {
22  _offendingNumber = 0.0;
23  SetErrorCode(-2146233048);
24  }
25 
28  public NotFiniteNumberException(double offendingNumber)
29  {
30  _offendingNumber = offendingNumber;
31  SetErrorCode(-2146233048);
32  }
33 
36  public NotFiniteNumberException(string message)
37  : base(message)
38  {
39  _offendingNumber = 0.0;
40  SetErrorCode(-2146233048);
41  }
42 
46  public NotFiniteNumberException(string message, double offendingNumber)
47  : base(message)
48  {
49  _offendingNumber = offendingNumber;
50  SetErrorCode(-2146233048);
51  }
52 
56  public NotFiniteNumberException(string message, Exception innerException)
57  : base(message, innerException)
58  {
59  SetErrorCode(-2146233048);
60  }
61 
66  public NotFiniteNumberException(string message, double offendingNumber, Exception innerException)
67  : base(message, innerException)
68  {
69  _offendingNumber = offendingNumber;
70  SetErrorCode(-2146233048);
71  }
72 
77  : base(info, context)
78  {
79  _offendingNumber = info.GetInt32("OffendingNumber");
80  }
81 
86  [SecurityCritical]
87  public override void GetObjectData(SerializationInfo info, StreamingContext context)
88  {
89  if (info == null)
90  {
91  throw new ArgumentNullException("info");
92  }
93  base.GetObjectData(info, context);
94  info.AddValue("OffendingNumber", _offendingNumber, typeof(int));
95  }
96  }
97 }
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
NotFiniteNumberException(string message, double offendingNumber, Exception innerException)
Initializes a new instance of the T:System.NotFiniteNumberException class with a specified error mess...
double OffendingNumber
Gets the invalid number that is a positive infinity, a negative infinity, or Not-a-Number (NaN).
Definition: __Canon.cs:3
Describes the source and destination of a given serialized stream, and provides an additional caller-...
Provides information about, and means to manipulate, the current environment and platform....
Definition: Environment.cs:21
NotFiniteNumberException(string message)
Initializes a new instance of the T:System.NotFiniteNumberException class with a specified error mess...
NotFiniteNumberException(string message, double offendingNumber)
Initializes a new instance of the T:System.NotFiniteNumberException class with a specified error mess...
Stores all the data needed to serialize or deserialize an object. This class cannot be inherited.
The exception that is thrown when a floating-point value is positive infinity, negative infinity,...
NotFiniteNumberException(string message, Exception innerException)
Initializes a new instance of the T:System.NotFiniteNumberException class with a specified error mess...
Represents errors that occur during application execution.To browse the .NET Framework source code fo...
Definition: Exception.cs:22
NotFiniteNumberException(double offendingNumber)
Initializes a new instance of the T:System.NotFiniteNumberException class with the invalid number.
NotFiniteNumberException()
Initializes a new instance of the T:System.NotFiniteNumberException class.
Specifies that the class can be serialized.
override void GetObjectData(SerializationInfo info, StreamingContext context)
Sets the T:System.Runtime.Serialization.SerializationInfo object with the invalid number and addition...
The exception that is thrown for errors in an arithmetic, casting, or conversion operation.
NotFiniteNumberException(SerializationInfo info, StreamingContext context)
Initializes a new instance of the T:System.NotFiniteNumberException class with serialized data.