using System.Globalization;
using System.Runtime.Serialization;
-namespace System.Data {
-
+namespace System.Data
+{
[Serializable]
public class TypedDataSetGeneratorException : DataException
{
-
- ArrayList errorList;
+ readonly ArrayList errorList;
#region Constructors
+
public TypedDataSetGeneratorException ()
- : base (Locale.GetText ("There is a name conflict"))
+ : base (Locale.GetText ("System error."))
{
}
public TypedDataSetGeneratorException (ArrayList list)
- : base (Locale.GetText ("There is a name conflict"))
+ : base (Locale.GetText ("System error."))
{
errorList = list;
}
protected TypedDataSetGeneratorException (SerializationInfo info, StreamingContext context)
: base (info, context)
{
+ int count = info.GetInt32 ("KEY_ARRAYCOUNT");
+ errorList = new ArrayList (count);
+
+ for (int i=0; i < count; i++)
+ errorList.Add (info.GetString("KEY_ARRAYVALUES" + i));
}
- #endregion //Constructors
+#if NET_2_0
+ public TypedDataSetGeneratorException (String error) : base (error)
+ {
+ }
+
+ public TypedDataSetGeneratorException (String error, Exception inner)
+ : base (error, inner)
+ {
+ }
+#endif
+ #endregion //Constructors
- public ArrayList ErrorList
- {
- get
- {
- return errorList;
- }
-
+ public ArrayList ErrorList {
+ get { return errorList; }
}
#region Methods
-
- public override void GetObjectData (SerializationInfo si, StreamingContext context)
- {
- if (si == null)
- throw new ArgumentNullException ("si");
-
- si.AddValue ("ErrorList", errorList);
- base.GetObjectData (si, context);
- }
-
- #endregion // Methods
+ public override void GetObjectData (SerializationInfo info, StreamingContext context)
+ {
+ base.GetObjectData (info, context);
+
+ int count = (errorList != null) ? ErrorList.Count : 0;
+ info.AddValue ("KEY_ARRAYCOUNT", count);
+
+ for (int i=0; i < count; i++)
+ info.AddValue ("KEY_ARRAYVALUES" + i, ErrorList [i]);
+ }
+
+ #endregion // Methods
}
}