Ver código fonte

2005-11-11 Senganal T <[email protected]>

	* Test/System.Data/DataSetTest2.cs : Added a testcase for bug#76517 
	* System.Data.dll.sources: added
	System.Data/SchemaSerializationMode.cs . Enumeration for NET_2_0 compatibility	
	* System.Data/DataSet.cs : Added the SchemaSerializationMode Property for NET_2_0
	compatibility.
	* System.Data/SchemaSerializationMode.cs : Added SchemaSerializationMode Enumeration
	for NET_2_0 compatibility.

	Fixes bug #76517


svn path=/trunk/mcs/; revision=52899
Senganal T 20 anos atrás
pai
commit
fdf6b8fdf3

+ 5 - 0
mcs/class/System.Data/ChangeLog

@@ -1,3 +1,8 @@
+2005-11-11  Senganal T  <[email protected]>
+
+	* System.Data.dll.sources: added
+	System.Data/SchemaSerializationMode.cs : Enumeration for NET_2_0 compatibility	
+
 2005-10-08  Sureshkumar T  <[email protected]>
 
 	* System.Data.dll.sources: added

+ 1 - 0
mcs/class/System.Data/System.Data.dll.sources

@@ -112,6 +112,7 @@ System.Data/ResultSetSensitivity.cs
 System.Data/RowNotInTableException.cs
 System.Data/Rule.cs
 System.Data/SchemaType.cs
+System.Data/SchemaSerializationMode.cs
 System.Data/SqlDbType.cs
 System.Data/StateChangeEventArgs.cs
 System.Data/StateChangeEventHandler.cs

+ 9 - 0
mcs/class/System.Data/System.Data/ChangeLog

@@ -1,3 +1,12 @@
+2005-11-11  Senganal T <[email protected]>
+
+	* DataSet.cs : Added the SchemaSerializationMode Property for NET_2_0
+	compatibility.
+	* SchemaSerializationMode.cs : Added SchemaSerializationMode Enumeration
+	for NET_2_0 compatibility.
+
+	Fixes bug #76517
+
 2005-10-20  Atsushi Enomoto  <[email protected]>
 
 	* XmlSchemaWriter.cs : escape names in the schema with XmlConvert.

+ 15 - 0
mcs/class/System.Data/System.Data/DataSet.cs

@@ -336,6 +336,21 @@ namespace System.Data {
 			get { return tableCollection; }
 		}
 
+#if NET_2_0
+		public virtual SchemaSerializationMode SchemaSerializationMode {
+
+			get {
+				return SchemaSerializationMode.IncludeSchema;		
+			}
+
+			set {
+				if (value != SchemaSerializationMode.IncludeSchema) 
+					throw new InvalidOperationException (
+							"Only IncludeSchema Mode can be set for Untyped DataSet");
+			}
+		}
+#endif 
+
 		#endregion // Public Properties
 
 		#region Public Methods

+ 39 - 0
mcs/class/System.Data/System.Data/SchemaSerializationMode.cs

@@ -0,0 +1,39 @@
+//
+// System.Data.SchemaSerializationMode.cs
+//
+// Author:
+//   Senganal T ([email protected])
+//
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0
+namespace System.Data {
+
+	public enum SchemaSerializationMode 
+	{
+		ExcludeSchema,
+		IncludeSchema
+	}
+}
+#endif 

+ 4 - 0
mcs/class/System.Data/Test/System.Data/ChangeLog

@@ -1,3 +1,7 @@
+2005-11-11 Senganal T <[email protected]>
+
+	* DataSetTest2.cs : Added a testcase for bug#76517 
+
 2005-10-24  Konstantin Triger <[email protected]>
 
 	* DataTableTest.cs: Added test for object type validation (ColumnObjectTypeTest)

+ 17 - 0
mcs/class/System.Data/Test/System.Data/DataSetTest2.cs

@@ -2735,5 +2735,22 @@ namespace MonoTests_System.Data
 			// Checking ExtendedProperties count
 			Assert.AreEqual(0, pc.Count , "DS374");
 		}
+
+#if NET_2_0
+		// Test for bug #76517
+		[Test] public void SchemaSerializationModeTest ()
+		{
+			DataSet ds = new DataSet ();
+			Assert.AreEqual (SchemaSerializationMode.IncludeSchema,
+					ds.SchemaSerializationMode, "#1");
+			try {
+				ds.SchemaSerializationMode = SchemaSerializationMode.ExcludeSchema;
+				Assert.Fail ("#2 InvalidOperationException must be thrown");
+			}catch (InvalidOperationException e) {
+				//ok 	
+			}	
+		}	
+#endif
+
 	}
 }