added missing [Serializable] attribute
[mono.git] / mcs / class / corlib / System / ArgumentOutOfRangeException.cs
1 //
2 // System.ArgumentOutOfRangeException.cs
3 //
4 // Author:
5 //   Joe Shaw (joe@ximian.com)
6 //   Duncan Mak (duncan@ximian.com)
7 //
8 // (C) 2001 Ximian, Inc.  http://www.ximian.com
9 //
10
11 using System.Globalization;
12 using System.Runtime.Serialization;
13
14 namespace System {
15
16         [Serializable]
17         public class ArgumentOutOfRangeException : ArgumentException {
18                 private object actual_value;
19
20                 // Constructors
21                 public ArgumentOutOfRangeException ()
22                         : base (Locale.GetText ("Argument is out of range"))
23                 {
24                 }
25
26                 public ArgumentOutOfRangeException (string param_name)
27                         : base (Locale.GetText ("Argument is out of range"), param_name)
28                 {
29                 }
30
31                 public ArgumentOutOfRangeException (string param_name, string message)
32                         : base (message, param_name)
33                 {
34                 }
35
36                 public ArgumentOutOfRangeException (string param_name, object actual_value, string message)
37                         : base (message, param_name)
38                 {
39                         this.actual_value = actual_value;
40                 }
41
42                 protected ArgumentOutOfRangeException (SerializationInfo info, StreamingContext context)
43                         : base (info, context)
44                 {
45                         actual_value = info.GetString ("ActualValue");
46                 }
47  
48                 // Properties
49                 public virtual object ActualValue {
50                         get {
51                                 return actual_value;
52                         }
53                 }
54
55                 // Methods
56                 public override void GetObjectData (SerializationInfo info, StreamingContext context)
57                 {
58                         base.GetObjectData (info, context);
59                         info.AddValue ("ActualValue", actual_value);
60                 }
61                 
62         }
63 }