1 //------------------------------------------------------------------------------
2 // <copyright file="StrongTypingException.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
5 // <owner current="true" primary="true">[....]</owner>
6 // <owner current="true" primary="false">[....]</owner>
7 // <owner current="false" primary="false">[....]</owner>
8 //------------------------------------------------------------------------------
10 namespace System
.Data
{
12 using System
.Collections
;
14 using System
.Runtime
.Serialization
;
18 /// <para>DEV: The exception that is throwing from strong typed DataSet when user access to DBNull value.</para>
21 public class StrongTypingException
: DataException
{
22 protected StrongTypingException(SerializationInfo info
, StreamingContext context
)
23 : base(info
, context
) {
26 /// <para>[To be supplied.]</para>
28 public StrongTypingException() : base() {
29 HResult
= HResults
.StrongTyping
;
32 public StrongTypingException(string message
) : base(message
) {
33 HResult
= HResults
.StrongTyping
;
37 /// <para>[To be supplied.]</para>
39 public StrongTypingException(string s
, Exception innerException
) : base(s
, innerException
) {
40 HResult
= HResults
.StrongTyping
;
46 /// <para>DEV: The exception that is throwing in generating strong typed DataSet when name conflict happens.</para>
49 public class TypedDataSetGeneratorException
: DataException
{
50 private ArrayList errorList
;
51 private string KEY_ARRAYCOUNT
= "KEY_ARRAYCOUNT";
52 private string KEY_ARRAYVALUES
= "KEY_ARRAYVALUES";
54 protected TypedDataSetGeneratorException(SerializationInfo info
, StreamingContext context
)
55 : base(info
, context
) {
56 int count
= (int) info
.GetValue(KEY_ARRAYCOUNT
, typeof(System
.Int32
));
58 errorList
= new ArrayList();
59 for (int i
= 0; i
< count
; i
++) {
60 errorList
.Add(info
.GetValue(KEY_ARRAYVALUES
+ i
, typeof(System
.String
)));
68 /// <para>[To be supplied.]</para>
70 public TypedDataSetGeneratorException() : base() {
72 HResult
= HResults
.StrongTyping
;
75 public TypedDataSetGeneratorException(string message
) : base(message
) {
76 HResult
= HResults
.StrongTyping
;
79 public TypedDataSetGeneratorException(string message
, Exception innerException
) : base(message
, innerException
) {
80 HResult
= HResults
.StrongTyping
;
84 /// <para>[To be supplied.]</para>
86 public TypedDataSetGeneratorException(ArrayList list
) : this() {
88 HResult
= HResults
.StrongTyping
;
92 /// <para>[To be supplied.]</para>
94 public ArrayList ErrorList
{
100 [System
.Security
.Permissions
.SecurityPermissionAttribute(System
.Security
.Permissions
.SecurityAction
.LinkDemand
, Flags
=System
.Security
.Permissions
.SecurityPermissionFlag
.SerializationFormatter
)]
101 public override void GetObjectData(SerializationInfo info
, StreamingContext context
)
103 base.GetObjectData(info
, context
);
105 if (errorList
!= null) {
106 info
.AddValue(KEY_ARRAYCOUNT
, errorList
.Count
);
107 for (int i
= 0; i
< errorList
.Count
; i
++) {
108 info
.AddValue(KEY_ARRAYVALUES
+ i
, errorList
[i
].ToString());
112 info
.AddValue(KEY_ARRAYCOUNT
, 0);