2002-04-28 Daniel Morgan <danmorg@sc.rr.com>
authorDaniel Morgan <monodanmorg@yahoo.com>
Sun, 28 Apr 2002 03:59:01 +0000 (03:59 -0000)
committerDaniel Morgan <monodanmorg@yahoo.com>
Sun, 28 Apr 2002 03:59:01 +0000 (03:59 -0000)
* System.Data/DataRelation.cs
* System.Data/ForeignKeyConstraint.cs
* System.Data/UniqueConstraint.cs: added more stubs

* System.Data/DataTableRelationCollection.cs: added back to cvs
and modified for compile errors.  DataRelationCollection is an
abstract class and there must be a class that implements for
DataTable/DataSet.  DataTableRelationCollection was changed
to an internal class.

* System.Data.build: modified - new files added
also wanted to include files/classes in the build
so we can get a compilable forward read only result set.
It compiles now using csc/nant with warnings, but this
is a start for adding functionality for the result set.
Classes associated with/and DataSet are still excluded.

* TODO: modified - updated to do list for System.Data

* System.Data/Constraint.cs
* System.Data/ConstraintCollection.cs
* System.Data/DataRelationCollection.cs
* System.Data/DataRow.cs
* System.Data/DataRowChangeEventArgs.cs
* System.Data/DataRowCollection.cs
* System.Data/DataTable.cs
* System.Data/DataTableCollection.cs
* System.Data/InternalDataCollectionBase.cs
* System.Data/PropertyCollection.cs: modified -
changes to compile SqlDataReader/DataTable and
dependencies

* System.Data/IDbCommand.cs
* System.Data.SqlClient/SqlCommand.cs: modified -
un-commented overloaded methods ExecuteReader
which returns a SqlDataReader

svn path=/trunk/mcs/; revision=4098

25 files changed:
mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlCommand.cs
mcs/class/Mono.Data.PostgreSqlClient/Mono.Data.PostgreSqlClient/PgSqlDataReader.cs
mcs/class/Mono.Data.PostgreSqlClient/PgSqlCommand.cs
mcs/class/Mono.Data.PostgreSqlClient/PgSqlDataReader.cs
mcs/class/System.Data/ChangeLog
mcs/class/System.Data/System.Data.SqlClient/SqlCommand.cs
mcs/class/System.Data/System.Data.SqlClient/SqlDataReader.cs
mcs/class/System.Data/System.Data.build
mcs/class/System.Data/System.Data/AcceptRejectRule.cs
mcs/class/System.Data/System.Data/Constraint.cs
mcs/class/System.Data/System.Data/ConstraintCollection.cs
mcs/class/System.Data/System.Data/DataRelation.cs [new file with mode: 0644]
mcs/class/System.Data/System.Data/DataRelationCollection.cs
mcs/class/System.Data/System.Data/DataRow.cs
mcs/class/System.Data/System.Data/DataRowChangeEventArgs.cs
mcs/class/System.Data/System.Data/DataRowCollection.cs
mcs/class/System.Data/System.Data/DataTable.cs
mcs/class/System.Data/System.Data/DataTableCollection.cs
mcs/class/System.Data/System.Data/DataTableRelationCollection.cs [new file with mode: 0644]
mcs/class/System.Data/System.Data/ForeignKeyConstraint.cs [new file with mode: 0644]
mcs/class/System.Data/System.Data/IDbCommand.cs
mcs/class/System.Data/System.Data/InternalDataCollectionBase.cs
mcs/class/System.Data/System.Data/PropertyCollection.cs
mcs/class/System.Data/System.Data/UniqueConstraint.cs [new file with mode: 0644]
mcs/class/System.Data/TODO

index 02151854f49e572120f0a93f20dbc9f46009a705..51fdc2d93e4729852387b59959401310c2a34ef5 100644 (file)
@@ -163,14 +163,10 @@ namespace System.Data.SqlClient
                        return rowsAffected;
                }
                
-               // FIXME: temporarily commmented out, so I could get a simple working
-               //        SqlConnection and SqlCommand.  I had to temporarily
-               //        comment it out the ExecuteReader in IDbCommand as well.
-               /*
                [MonoTODO]
                IDataReader IDbCommand.ExecuteReader ()
                {
-                       throw new NotImplementedException ();   
+                       return ExecuteReader ();
                }
 
                [MonoTODO]
@@ -183,7 +179,7 @@ namespace System.Data.SqlClient
                IDataReader IDbCommand.ExecuteReader (
                                        CommandBehavior behavior)
                {
-                       throw new NotImplementedException ();
+                       return ExecuteReader (behavior);
                }
 
                [MonoTODO]
@@ -191,7 +187,6 @@ namespace System.Data.SqlClient
                {
                        throw new NotImplementedException ();
                }
-               */
 
                [MonoTODO]
                public object ExecuteScalar ()
index ca2409cd39bfdfeb34394906723a997fc9590608..5e3fb572db6862b5abd39eff73794f16803ddd20 100644 (file)
@@ -211,7 +211,6 @@ namespace System.Data.SqlClient
 
                #endregion // Destructors
 
-
                #region Properties
 
                public int Depth {
index 02151854f49e572120f0a93f20dbc9f46009a705..51fdc2d93e4729852387b59959401310c2a34ef5 100644 (file)
@@ -163,14 +163,10 @@ namespace System.Data.SqlClient
                        return rowsAffected;
                }
                
-               // FIXME: temporarily commmented out, so I could get a simple working
-               //        SqlConnection and SqlCommand.  I had to temporarily
-               //        comment it out the ExecuteReader in IDbCommand as well.
-               /*
                [MonoTODO]
                IDataReader IDbCommand.ExecuteReader ()
                {
-                       throw new NotImplementedException ();   
+                       return ExecuteReader ();
                }
 
                [MonoTODO]
@@ -183,7 +179,7 @@ namespace System.Data.SqlClient
                IDataReader IDbCommand.ExecuteReader (
                                        CommandBehavior behavior)
                {
-                       throw new NotImplementedException ();
+                       return ExecuteReader (behavior);
                }
 
                [MonoTODO]
@@ -191,7 +187,6 @@ namespace System.Data.SqlClient
                {
                        throw new NotImplementedException ();
                }
-               */
 
                [MonoTODO]
                public object ExecuteScalar ()
index ca2409cd39bfdfeb34394906723a997fc9590608..5e3fb572db6862b5abd39eff73794f16803ddd20 100644 (file)
@@ -211,7 +211,6 @@ namespace System.Data.SqlClient
 
                #endregion // Destructors
 
-
                #region Properties
 
                public int Depth {
index 59dc5342a0352a7154a8fe3752dac99f4ad5864b..3d9f79b96675a4abb6dd5785a64ca31e9118141b 100644 (file)
@@ -1,3 +1,42 @@
+2002-04-28  Daniel Morgan <danmorg@sc.rr.com>
+
+       * System.Data/DataRelation.cs
+       * System.Data/ForeignKeyConstraint.cs
+       * System.Data/UniqueConstraint.cs: added more stubs
+       
+       * System.Data/DataTableRelationCollection.cs: added back to cvs
+       and modified for compile errors.  DataRelationCollection is an
+       abstract class and there must be a class that implements for
+       DataTable/DataSet.  DataTableRelationCollection was changed
+       to an internal class.
+       
+       * System.Data.build: modified - new files added
+       also wanted to include files/classes in the build 
+       so we can get a compilable forward read only result set.
+       It compiles now using csc/nant with warnings, but this 
+       is a start for adding functionality for the result set.  
+       Classes associated with/and DataSet are still excluded.
+       
+       * TODO: modified - updated to do list for System.Data
+       
+       * System.Data/Constraint.cs
+       * System.Data/ConstraintCollection.cs
+       * System.Data/DataRelationCollection.cs
+       * System.Data/DataRow.cs
+       * System.Data/DataRowChangeEventArgs.cs
+       * System.Data/DataRowCollection.cs
+       * System.Data/DataTable.cs
+       * System.Data/DataTableCollection.cs
+       * System.Data/InternalDataCollectionBase.cs
+       * System.Data/PropertyCollection.cs: modified -
+       changes to compile SqlDataReader/DataTable and
+       dependencies
+       
+       * System.Data/IDbCommand.cs
+       * System.Data.SqlClient/SqlCommand.cs: modified -
+       un-commented overloaded methods ExecuteReader 
+       which returns a SqlDataReader
+
 2002-04-28  Rodrigo Moya <rodrigo@ximian.com>
 
        * System.Data/DataTableCollection.cs: more implementation.
index 02151854f49e572120f0a93f20dbc9f46009a705..51fdc2d93e4729852387b59959401310c2a34ef5 100644 (file)
@@ -163,14 +163,10 @@ namespace System.Data.SqlClient
                        return rowsAffected;
                }
                
-               // FIXME: temporarily commmented out, so I could get a simple working
-               //        SqlConnection and SqlCommand.  I had to temporarily
-               //        comment it out the ExecuteReader in IDbCommand as well.
-               /*
                [MonoTODO]
                IDataReader IDbCommand.ExecuteReader ()
                {
-                       throw new NotImplementedException ();   
+                       return ExecuteReader ();
                }
 
                [MonoTODO]
@@ -183,7 +179,7 @@ namespace System.Data.SqlClient
                IDataReader IDbCommand.ExecuteReader (
                                        CommandBehavior behavior)
                {
-                       throw new NotImplementedException ();
+                       return ExecuteReader (behavior);
                }
 
                [MonoTODO]
@@ -191,7 +187,6 @@ namespace System.Data.SqlClient
                {
                        throw new NotImplementedException ();
                }
-               */
 
                [MonoTODO]
                public object ExecuteScalar ()
index ca2409cd39bfdfeb34394906723a997fc9590608..5e3fb572db6862b5abd39eff73794f16803ddd20 100644 (file)
@@ -211,7 +211,6 @@ namespace System.Data.SqlClient
 
                #endregion // Destructors
 
-
                #region Properties
 
                public int Depth {
index 091dc7ce643674156ecfa0bc1ffdc99f2f653a55..f94f161baadf44a4aae414fde92ac3dd2fec3c01 100644 (file)
@@ -11,6 +11,7 @@
                        <arg value="/unsafe"/>\r
                        <sources>\r
                                <includes name="**/*.cs"/> \r
+                               <!--\r
                                <excludes name="System.Data/Constraint.cs"/>\r
                                <excludes name="System.Data/ConstraintCollection.cs"/>\r
                                <excludes name="System.Data/InternalDataCollectionBase.cs"/>\r
                                <excludes name="System.Data/DataRow.cs"/>\r
                                <excludes name="System.Data/DataRowCollection.cs"/>\r
                                <excludes name="System.Data/DataRowChangeEventArgs.cs"/>\r
-                               <excludes name="System.Data/DataTableCollection.cs"/>\r
                                <excludes name="System.Data/DataRelationCollection.cs"/>\r
                                <excludes name="System.Data/DataTable.cs"/>\r
+                               <excludes name="System.Data/PropertyCollection.cs"/>\r
+                               -->\r
+                               <excludes name="System.Data/DataTableRelationCollection.cs"/>\r
                                <excludes name="System.Data/DataView.cs"/>\r
                                <excludes name="System.Data/DataSet.cs"/>\r
-                               <excludes name="System.Data/PropertyCollection.cs"/>\r
                                <excludes name="Test/**"/>\r
                                <excludes name="System.Data.Common/*"/>\r
                                <excludes name="System.Data.SqlClient/SqlDataAdapter.cs"/>\r
-                               <excludes name="System.Data.SqlClient/SqlDataReader.cs"/>\r
+                               <!--<excludes name="System.Data.SqlClient/SqlDataReader.cs"/>-->\r
                                <excludes name="System.Data.SqlClient/SqlInfoMessageEventArgs.cs"/>\r
                                <excludes name="System.Data.SqlClient/SqlRowUpdatingEventArgs.cs"/>\r
                                <excludes name="System.Data.SqlClient/SqlRowUpdatedEventArgs.cs"/>\r
index bb98d27cf032c3100e5e13c4fbeff2f65bbed86e..c4481175a6c5d57e51308fdfb716d521f214c7d0 100644 (file)
@@ -11,7 +11,9 @@ namespace System.Data
 {
        
        /// <summary>
-       /// Determines the action that occurs when the AcceptChanges or RejectChanges method is invoked on a DataTable with a ForeignKeyConstraint.
+       /// Determines the action that occurs when 
+       /// the AcceptChanges or RejectChanges method 
+       /// is invoked on a DataTable with a ForeignKeyConstraint.
        /// </summary>
        [Serializable]
        public enum AcceptRejectRule
@@ -20,4 +22,4 @@ namespace System.Data
                None = 0
        }
 
-}
\ No newline at end of file
+}
index 80d0a78c5ac0a0c06202206284882bfa17919bd0..d6ce3b24307a9df58bf3b2e843831eb80b8d5ac0 100644 (file)
@@ -11,49 +11,52 @@ using System;
 using System.Collections;
 using System.ComponentModel;
 using System.Runtime.InteropServices;
+using System.Runtime.Serialization;
 
 namespace System.Data
 {
        [Serializable]
        public abstract class Constraint {
 
+               protected string name = null;
+               protected PropertyCollection properties = null;
+
                [MonoTODO]
-               [Serializable]
                protected Constraint() {
+                       properties = new PropertyCollection();
                }
 
-               [Serializable]
                public virtual string ConstraintName {
-                       [MonoTODO]
+                       [MonoTODO]      
                        get{
+                               return name;
                        } 
 
                        [MonoTODO]
                        set{
+                               name = value;
                        }
                }
 
-               [Serializable]
                public PropertyCollection ExtendedProperties {
                        [MonoTODO]
                        get {
+                               return properties;
                        }
                }
 
-               [Serializable]
                public abstract DataTable Table {
                        get;
                }
 
                [MonoTODO]
-               [Serializable]
                public override string ToString() {
+                       return name;
                }
 
-               [MonoTODO]
-               [Serializable]
-               [ClassInterface(ClassInterfaceType.AutoDual)]
-               ~Constraint() {
-               }
+               //[MonoTODO]
+               //[ClassInterface(ClassInterfaceType.AutoDual)]
+               //~Constraint() {
+               //}
        }
 }
index 97eca9c56b69ab0e658f9b0702d85bb5534927a4..7e9385e7e6bf317c6a965ace7f3fe92f56e7ff2d 100644 (file)
@@ -5,6 +5,7 @@
 //   Daniel Morgan
 //
 // (C) Ximian, Inc. 2002
+// (C) 2002 Daniel Morgan
 //
 
 using System;
@@ -18,120 +19,123 @@ namespace System.Data
        /// </summary>
        public class ConstraintCollection : InternalDataCollectionBase {
 
-               [MonoTODO]
-               [Serializable]
                public virtual Constraint this[string name] {
                        [MonoTODO]
                        get {
+                               throw new NotImplementedException ();
                        }
                }
-
-               [MonoTODO]
-               [Serializable]
+               
                public virtual Constraint this[int index] {
                        [MonoTODO]
                        get {
+                               throw new NotImplementedException ();
                        }
                }
 
                // Overloaded Add method (5 of them)
                // to add Constraint object to the collection
 
-               [Serializable]
                [MonoTODO]
                public void Add(Constraint constraint) {
+                       
+                       throw new NotImplementedException ();
                }
 
-               [Serializable]
                [MonoTODO]
                public virtual Constraint Add(string name,
                        DataColumn column, bool primaryKey) {
+
+                       throw new NotImplementedException ();
+
                }
 
-               [Serializable]
                [MonoTODO]
                public virtual Constraint Add(string name,
                        DataColumn primaryKeyColumn,
                        DataColumn foreignKeyColumn) {
+
+                       throw new NotImplementedException ();
                }
 
-               [Serializable]
                [MonoTODO]
                public virtual Constraint Add(string name,
                        DataColumn[] columns, bool primaryKey) {
+
+                       throw new NotImplementedException ();
                }
 
-               [Serializable]
                [MonoTODO]
                public virtual Constraint Add(string name,
                        DataColumn[] primaryKeyColumns,
                        DataColumn[] foreignKeyColumns) {
+
+                       throw new NotImplementedException ();
                }
 
-               [Serializable]
                [MonoTODO]
                public void AddRange(Constraint[] constraints) {
+
+                       throw new NotImplementedException ();
                }
 
-               [Serializable]
                [MonoTODO]
                public bool CanRemove(Constraint constraint) {
+
+                       throw new NotImplementedException ();
                }
 
-               [Serializable]
                [MonoTODO]
                public void Clear() {
+                       
+                       throw new NotImplementedException ();
                }
 
-               [Serializable]
                [MonoTODO]
                public bool Contains(string name) {
+                       throw new NotImplementedException ();
                }
 
-               [Serializable]
                [MonoTODO]
                public int IndexOf(Constraint constraint) {
+                       throw new NotImplementedException ();
                }
 
-               [Serializable]
                [MonoTODO]
                public virtual int IndexOf(string constraintName) {
+                       throw new NotImplementedException ();
                }
 
-               [Serializable]
                [MonoTODO]
                public void Remove(Constraint constraint) {
+                       throw new NotImplementedException ();
                }
 
-               [Serializable]
                [MonoTODO]
                public void Remove(string name) {
+                       throw new NotImplementedException ();
                }
 
-               [Serializable]
                [MonoTODO]
                public void RemoveAt(int index) {
+                       throw new NotImplementedException ();
                }
 
-               /*
-                * FIXME: fix this event
-               [Serializable]
                [MonoTODO]
                public event CollectionChangeEventHandler CollectionChanged;
-               */
 
-               [Serializable]
                protected override ArrayList List {
                        [MonoTODO]
                        get{
+                               throw new NotImplementedException ();
                        }
                }
 
-               [Serializable]
                [MonoTODO]
                protected virtual void OnCollectionChanged(
                        CollectionChangeEventArgs ccevent) {
-               }
 
+                       throw new NotImplementedException ();
+               }
        }
 }
diff --git a/mcs/class/System.Data/System.Data/DataRelation.cs b/mcs/class/System.Data/System.Data/DataRelation.cs
new file mode 100644 (file)
index 0000000..bbc1f2e
--- /dev/null
@@ -0,0 +1,165 @@
+//
+// System.Data.DataRelation.cs
+//
+// Author:
+//   Daniel Morgan <danmorg@sc.rr.com>
+//
+// (C) 2002 Daniel Morgan
+// (C) 2002 Ximian, Inc.
+//
+
+using System;
+using System.Runtime.Serialization;
+
+namespace System.Data
+{
+       /// <summary>
+       /// DataRelation is used for a parent/child relationship 
+       /// between two DataTable objects
+       /// </summary>
+       [Serializable]
+       public class DataRelation {
+
+               #region Constructors
+
+               [MonoTODO]
+               public DataRelation(string relationName,
+                       DataColumn parentColumn, DataColumn childColumn) {
+
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public DataRelation(string relationName,
+                       DataColumn[] parentColumns, 
+                       DataColumn[] childColumns) {
+
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public DataRelation(string relationName,
+                       DataColumn parentColumn, DataColumn childColumn,
+                       bool createConstraints) {
+
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public DataRelation(string relationName,
+                       DataColumn[] parentColumns, DataColumn[] childColumns,
+                       bool createConstraints) {
+
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public DataRelation(string relationName,
+                       string parentTableName, string childTableName,
+                       string[] parentColumnNames, string[] childColumnNames,
+                       bool nested) {
+
+                       throw new NotImplementedException ();
+               }
+
+               #endregion // Constructors
+
+               #region Properties
+
+               public virtual DataColumn[] ChildColumns {
+                       [MonoTODO]
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public virtual ForeignKeyConstraint ChildKeyConstraint {
+                       [MonoTODO]
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public virtual DataTable ChildTable {
+                       [MonoTODO]
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public virtual DataSet DataSet {
+                       [MonoTODO]
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public PropertyCollection ExtendedProperties {
+                       [MonoTODO]
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public virtual bool Nested {
+                       [MonoTODO]
+                       get {
+                               throw new NotImplementedException ();
+                       } 
+                       
+                       [MonoTODO]
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public virtual DataColumn[] ParentColumns {
+                       [MonoTODO]
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public virtual UniqueConstraint ParentKeyConstraint {
+                       [MonoTODO]
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public virtual DataTable ParentTable {
+                       [MonoTODO]
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public virtual string RelationName {
+                       [MonoTODO]
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       
+                       [MonoTODO]
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               [MonoTODO]
+               public override string ToString() {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               protected void CheckStateForProperty() {
+                       throw new NotImplementedException ();
+               }
+
+               #endregion // Methods
+       }
+}
index aeff4beb1b5bf51a94d0f1bc46b2900b2be73934..fddb0d55022d5817fffbd1c8c1ecaef49d0af605 100644 (file)
@@ -3,8 +3,10 @@
 //
 // Author:
 //   Christopher Podurgiel (cpodurgiel@msn.com)
+//   Daniel Morgan <danmorg@sc.rr.com>
 //
 // (C) Chris Podurgiel
+// (C) 2002 Daniel Morgan
 //
 
 using System;
@@ -21,6 +23,7 @@ namespace System.Data
        {
                private bool inTransition;
                private int defaultNameIndex;           
+               private ArrayList relations = null;
                
                /// <summary>
                /// Initializes a new instance of the DataRelationCollection class.
@@ -29,6 +32,7 @@ namespace System.Data
                {
                        defaultNameIndex = 1;
                        inTransition = false;
+                       relations = new ArrayList();
                }
 
                /// <summary>
@@ -47,6 +51,7 @@ namespace System.Data
                /// Adds a DataRelation to the DataRelationCollection.
                /// </summary>
                /// <param name="relation">The DataRelation to add to the collection.</param>
+               [MonoTODO]
                public void Add(DataRelation relation)
                {
                        if(relation != null)
@@ -67,6 +72,7 @@ namespace System.Data
                /// <param name="parentColumn">parent column of relation.</param>
                /// <param name="childColumn">child column of relation.</param>
                /// <returns>The created DataRelation.</returns>
+               [MonoTODO]
                public virtual DataRelation Add(DataColumn parentColumn, DataColumn childColumn)
                {       
                        
@@ -79,10 +85,13 @@ namespace System.Data
                                throw new ArgumentNullException("childColumn");
                        }
 
+                       // FIXME: temporarily commented so we can compile
+                       /*
                        if(parentColumn.Table.DataSet != childColumn.Table.DataSet)
                        {
                                throw new InvalidConstraintException("my ex");
                        }
+                       */
                        
                        DataRelation dataRelation = new DataRelation("Relation" + defaultNameIndex.ToString(), parentColumn, childColumn);
                        //CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Add, this);
@@ -101,6 +110,7 @@ namespace System.Data
                /// <param name="parentColumns">An array of parent DataColumn objects.</param>
                /// <param name="childColumns">An array of child DataColumn objects.</param>
                /// <returns>The created DataRelation.</returns>
+               [MonoTODO]
                public virtual DataRelation Add(DataColumn[] parentColumns, DataColumn[] childColumns)
                {
                        DataRelation dataRelation = new DataRelation("Relation" + defaultNameIndex.ToString(), parentColumns, childColumns);
@@ -120,6 +130,7 @@ namespace System.Data
                /// <param name="parentColumn">parent column of relation.</param>
                /// <returns>The created DataRelation.</returns>
                /// <returns></returns>
+               [MonoTODO]
                public virtual DataRelation Add(string name, DataColumn parentColumn, DataColumn childColumn)
                {
                        //If no name was supplied, give it a default name.
@@ -141,6 +152,7 @@ namespace System.Data
                /// <param name="parentColumns">An array of parent DataColumn objects.</param>
                /// <param name="childColumns">An array of child DataColumn objects.</param>
                /// <returns>The created DataRelation.</returns>
+               [MonoTODO]
                public virtual DataRelation Add(string name, DataColumn[] parentColumns, DataColumn[] childColumns)
                {
                        //If no name was supplied, give it a default name.
@@ -167,6 +179,7 @@ namespace System.Data
                /// <param name="childColumn">child column of relation.</param>
                /// <param name="createConstraints">true to create constraints; otherwise false. (default is true)</param>
                /// <returns>The created DataRelation.</returns>
+               [MonoTODO]
                public virtual DataRelation Add(string name, DataColumn parentColumn, DataColumn childColumn, bool createConstraints)
                {
                        //If no name was supplied, give it a default name.
@@ -190,6 +203,7 @@ namespace System.Data
                /// <param name="childColumns">An array of child DataColumn objects.</param>
                /// <param name="createConstraints">true to create a constraint; otherwise false.</param>
                /// <returns>The created DataRelation.</returns>
+               [MonoTODO]
                public virtual DataRelation Add(string name, DataColumn[] parentColumns, DataColumn[] childColumns, bool createConstraints)
                {
                        //If no name was supplied, give it a default name.
@@ -210,6 +224,7 @@ namespace System.Data
                /// Performs verification on the table.
                /// </summary>
                /// <param name="relation">The relation to check.</param>
+               [MonoTODO]
                protected virtual void AddCore(DataRelation relation)
                {
                        if (relation == null)
@@ -233,19 +248,25 @@ namespace System.Data
                /// Copies the elements of the specified DataRelation array to the end of the collection.
                /// </summary>
                /// <param name="relations">The array of DataRelation objects to add to the collection.</param>
+               [MonoTODO]
                public virtual void AddRange(DataRelation[] relations)
                {
-                       //TODO: Implement.
+                       //TODO: Implement
 
                        DataSet dataSet = GetDataSet();
 
+                       throw new NotImplementedException ();
+
+                       /*
                        foreach(DataRelation dataRelation in relations)
                        {
-                
+                               
                        }
+                       */
 
                }
 
+               [MonoTODO]
                public virtual bool CanRemove(DataRelation relation)
                {
                        //TODO: Implement.
@@ -254,8 +275,10 @@ namespace System.Data
 
                public virtual void Clear()
                {
+                       throw new NotImplementedException ();
                }
 
+               [MonoTODO]
                public virtual bool Contains(string name)
                {
                        return false;
@@ -273,33 +296,43 @@ namespace System.Data
                        return relations.IndexOf(this[relationName]);
                }
 
+               [MonoTODO]
                protected virtual void OnCollectionChanged(CollectionChangeEventArgs ccevent)
                {
+                       throw new NotImplementedException ();
                }
 
+               [MonoTODO]
                protected internal virtual void OnCollectionChanging(CollectionChangeEventArgs ccevent)
                {
+                       throw new NotImplementedException ();
                }
 
+               [MonoTODO]
                public void Remove(DataRelation relation)
                {
+                       throw new NotImplementedException ();
                }
 
+               [MonoTODO]
                public void Remove(string name)
                {
+                       throw new NotImplementedException ();
                }
 
+               [MonoTODO]
                public void RemoveAt(int index)
                {
+                       throw new NotImplementedException ();
                }
 
+               [MonoTODO]
                protected virtual void RemoveCore(DataRelation relation)
                {
+                       throw new NotImplementedException ();
                }
 
                public event CollectionChangeEventHandler CollectionChanged;
 
-
-
        }
 }
index 077c91815d168e6296b891932c665b8cb0b8415f..6a2814e606b25826220e60546a34209dfc3ef661 100644 (file)
@@ -5,9 +5,13 @@
 //   Rodrigo Moya <rodrigo@ximian.com>
 //   Daniel Morgan <danmorg@sc.rr.com>
 //
-// (C) Ximian, Inc
+// (C) Ximian, Inc 2002
+// (C) Daniel Morgan 2002
 //
 
+using System;
+using System.Collections;
+
 namespace System.Data
 {
        /// <summary>
@@ -19,6 +23,7 @@ namespace System.Data
 
                private ArrayList columns = new ArrayList();
                private ArrayList columnNames = new ArrayList();
+               private DataTable table = null;
 
                #endregion
 
@@ -198,64 +203,76 @@ namespace System.Data
 
                #region Properties
 
-               [MonoTODO]
                public bool HasErrors {
+                       [MonoTODO]
                        get { throw new NotImplementedException (); }
                }
 
-               [MonoTODO]
                public object this[string s] {
+                       [MonoTODO]
                        get { throw new NotImplementedException (); }
+
+                       [MonoTODO]
                        set { throw new NotImplementedException (); }
                }
 
-               [MonoTODO]
                public object this[DataColumn dc] {
+                       [MonoTODO]
                        get { throw new NotImplementedException (); }
+
+                       [MonoTODO]
                        set { throw new NotImplementedException (); }
                }
 
-               [MonoTODO]
                public object this[int i] {
+                       [MonoTODO]
                        get { throw new NotImplementedException (); }
+
+                       [MonoTODO]
                        set { throw new NotImplementedException (); }
                }
 
-               [MonoTODO]
                public object this[string s, DataRowVersion version] {
+                       [MonoTODO]
                        get { throw new NotImplementedException (); }
                }
 
-               [MonoTODO]
                public object this[DataColumn dc, DataRowVersion version] {
+                       [MonoTODO]
                        get { throw new NotImplementedException (); }
                }
 
-               [MonoTODO]
                public object this[int i, DataRowVersion version] {
+                       [MonoTODO]
                        get { throw new NotImplementedException (); }
                }
 
-               [MonoTODO]
                public object[] ItemArray {
+                       [MonoTODO]
                        get { throw new NotImplementedException (); }
+
+                       [MonoTODO]
                        set { throw new NotImplementedException (); }
                }
 
-               [MonoTODO]
                public string RowError {
+                       [MonoTODO]
                        get { throw new NotImplementedException (); }
+
+                       [MonoTODO]
                        set { throw new NotImplementedException (); }
                }
 
-               [MonoTODO]
                public DataRowState RowState {
+                       [MonoTODO]
                        get { throw new NotImplementedException (); }
                }
 
-               [MonoTODO]
                public DataTable Table {
-                       get { throw new NotImplementedException (); }
+                       [MonoTODO]
+                       get {
+                               return table;
+                       }
                }
 
                #endregion // Public Properties
index a59068accbf8b4ac9babc78eb5ffdf5d03117894..5466ec822bf407601af375726450f02c65ab0cdc 100644 (file)
@@ -18,17 +18,21 @@ namespace System.Data
                [MonoTODO]
                public DataRowChangeEventArgs(DataRow row,\r
                        DataRowAction action) {
+
+                       throw new NotImplementedException ();
                }
 
                public DataRowAction Action {
                        [MonoTODO]
                        get {
+                               throw new NotImplementedException ();
                        }
                }
 
                public DataRow Row {
                        [MonoTODO]
                        get {
+                               throw new NotImplementedException ();
                        }
                }
 
index 0ba172e84ba63a66ccc40efb03395a68dcad4fce..d111d99aced65a2a04ca7a099ec37d09d60f199a 100644 (file)
@@ -7,6 +7,10 @@
 // (C) Ximian, Inc 2002
 //
 
+using System;
+using System.Collections;
+using System.ComponentModel;
+
 namespace System.Data
 {
        /// <summary>\r
@@ -18,64 +22,64 @@ namespace System.Data
                private ArrayList rows = null;
 
                // Item indexer
-               [Serializable]\r
                public DataRow this[int index] {
                        [MonoTODO]
                        get {
+                               return (DataRow) rows[index];
                        }
                }
 
-               [MonoTODO]
-               [Serializable]\r
+               [MonoTODO]\r
                public void Add(DataRow row) {
-                       row.Add(row);
+                       rows.Add(row);
                }
 
-               [MonoTODO]
-               [Serializable]\r
+               [MonoTODO]\r
                public virtual DataRow Add(object[] values) {
+                       throw new NotImplementedException ();
                }
 
-               [MonoTODO]
-               [Serializable]\r
+               [MonoTODO]\r
                public void Clear() {
+                       throw new NotImplementedException ();
                }
 
-               [MonoTODO]
-               [Serializable]\r
+               [MonoTODO]\r
                public bool Contains(object key) {
+                       throw new NotImplementedException ();
                }
 
-               [MonoTODO]
-               [Serializable]\r
+               [MonoTODO]\r
                public DataRow Find(object key) {
+                       throw new NotImplementedException ();
                }
 
-               [MonoTODO]
-               [Serializable]\r
+               [MonoTODO]\r
                public DataRow Find(object[] keys) {
+                       throw new NotImplementedException ();
                }
 
-               [MonoTODO]
-               [Serializable]\r
+               [MonoTODO]\r
                public void InsertAt(DataRow row, int pos) {
+                       throw new NotImplementedException ();
                }
 
-               [MonoTODO]
-               [Serializable]\r
+               [MonoTODO]\r
                public void Remove(DataRow row) {
+                       throw new NotImplementedException ();
                }
-
-               [Serializable]\r
+\r
+               [MonoTODO]\r
                public void RemoveAt(int index) {\r
+                       throw new NotImplementedException ();\r
                }\r
 \r
-               [Serializable]\r
+               [MonoTODO]\r
                protected override ArrayList List {\r
                        [MonoTODO]\r
                        get {\r
+                               return rows;\r
                        }\r
-               }\r
-               
+               }               
        }
 }
index 35c61dcb1609955a42ec9978ae5123a696062821..4c9bc19909070585268c17ccf91d490373f227ab 100644 (file)
@@ -28,16 +28,18 @@ namespace System.Data
                private bool _caseSensitive;
                private DataColumnCollection _columnCollection;
                private ConstraintCollection _constraintCollection;
-               // private DataSet _dataSet;      // FIXME: temporarily commented
-               // private DataView _defaultView; // FIXME: temporarily commented
+               // FIXME: temporarily commented
+               // private DataSet _dataSet;   
+               // private DataView _defaultView;
                private string _displayExpression;
                private PropertyCollection _extendedProperties;
                private bool _hasErrors;
                private CultureInfo _locale;
                private int _minimumCapacity;
                private string _nameSpace;
-               private DataTableRelationCollection _childRelations;
-               private DataTableRelationCollection _parentRelations;
+               // FIXME: temporarily commented
+               // private DataTableRelationCollection _childRelations; 
+               // private DataTableRelationCollection _parentRelations;
                private string _prefix;
                private DataColumn[] _primaryKey;
                private DataRowCollection _rows;
@@ -65,8 +67,10 @@ namespace System.Data
                        _displayExpression = null;
                        _primaryKey = null;
                        
-                       _childRelations = new DataTableRelationCollection();
-                       _parentRelations = new DataTableRelationCollection();
+                       // FIXME: temporaily commented DataTableRelationCollection
+                       // _childRelations = new DataTableRelationCollection();
+                       // _parentRelations = new DataTableRelationCollection();
+
                        //_nextRowID = 1;
                        //_elementColumnCount = 0;
                        //_caseSensitiveAmbient = true;
@@ -90,7 +94,7 @@ namespace System.Data
                
                public DataTable(string tableName)
                {
-                       // _dataSet = null; // FIXME: temporarily commented
+                       // _dataSet = null;     // FIXME: temporarily commented
                        // _defaultView = null; // FIXME: temporarily commented
                        _columnCollection = new DataColumnCollection(this);
                        //_constraintCollection = new ConstraintCollection(); TODO: uncomment after ConstraintCollection is built.
@@ -100,8 +104,11 @@ namespace System.Data
                        _caseSensitive = false;
                        _displayExpression = null;
                        _primaryKey = null;
-                       _childRelations = new DataTableRelationCollection();
-                       _parentRelations = new DataTableRelationCollection();
+                       
+                       // FIXME: temporarily commented DataTableRelationCollection
+                       // _childRelations = new DataTableRelationCollection();
+                       // _parentRelations = new DataTableRelationCollection();
+
                        //_nextRowID = 1;
                        //_elementColumnCount = 0;
                        //_caseSensitiveAmbient = true;
@@ -155,7 +162,9 @@ namespace System.Data
                {
                        get
                        {
-                               return (DataRelationCollection)_childRelations;
+                               // FIXME: temporarily commented to compile
+                               // return (DataRelationCollection)_childRelations;
+                               throw new NotImplementedException ();
                        }
                }
 
@@ -199,7 +208,8 @@ namespace System.Data
                }
 
                /// <summary>
-               /// Gets a customized view of the table which may include a filtered view, or a cursor position.
+               /// Gets a customized view of the table which may 
+               /// include a filtered view, or a cursor position.
                /// </summary>
                
                public DataView DefaultView
@@ -212,7 +222,8 @@ namespace System.Data
                */
 
                /// <summary>
-               /// Gets or sets the expression that will return a value used to represent this table in the user interface.
+               /// Gets or sets the expression that will return 
+               /// a value used to represent this table in the user interface.
                /// </summary>
                
                public string DisplayExpression 
@@ -239,7 +250,9 @@ namespace System.Data
                }
 
                /// <summary>
-               /// Gets a value indicating whether there are errors in any of the rows in any of the tables of the DataSet to which the table belongs.
+               /// Gets a value indicating whether there are errors in 
+               /// any of the rows in any of the tables of the DataSet to 
+               /// which the table belongs.
                /// </summary>
                public bool HasErrors
                {
@@ -250,7 +263,8 @@ namespace System.Data
                }
 
                /// <summary>
-               /// Gets or sets the locale information used to compare strings within the table.
+               /// Gets or sets the locale information used to 
+               /// compare strings within the table.
                /// </summary>
                public CultureInfo Locale
                {
@@ -280,7 +294,8 @@ namespace System.Data
                }
 
                /// <summary>
-               /// Gets or sets the namespace for the XML represenation of the data stored in the DataTable.
+               /// Gets or sets the namespace for the XML represenation 
+               /// of the data stored in the DataTable.
                /// </summary>
                public string Namespace
                {
@@ -295,18 +310,22 @@ namespace System.Data
                }
 
                /// <summary>
-               /// Gets the collection of parent relations for this DataTable.
+               /// Gets the collection of parent relations for 
+               /// this DataTable.
                /// </summary>
                public DataRelationCollection ParentRelations
                {
                        get
-                       {
-                               return _parentRelations;
+                       {       
+                               // FIXME: temporarily commented to compile
+                               // return _parentRelations;
+                               throw new NotImplementedException ();
                        }
                }
 
                /// <summary>
-               /// Gets or sets the namespace for the XML represenation of the data stored in the DataTable.
+               /// Gets or sets the namespace for the XML represenation
+               ///  of the data stored in the DataTable.
                /// </summary>
                public string Prefix
                {
@@ -321,7 +340,8 @@ namespace System.Data
                }
 
                /// <summary>
-               /// Gets or sets an array of columns that function as primary keys for the data table.
+               /// Gets or sets an array of columns that function as 
+               /// primary keys for the data table.
                /// </summary>
                public DataColumn[] PrimaryKey
                {
@@ -348,10 +368,11 @@ namespace System.Data
                }
 
                /// <summary>
-               /// Gets or sets an System.ComponentModel.ISite for the DataTable.
+               /// Gets or sets an System.ComponentModel.ISite 
+               /// for the DataTable.
                /// </summary>
                
-               public override ISite Site
+               public virtual ISite Site
                {
                        get
                        {
@@ -379,17 +400,19 @@ namespace System.Data
                        }
                }
 
-               bool IListSource.ContainsListCollection
+               /* FIXME: implement IListSource
+               public bool IListSource.ContainsListCollection
                {
                        get
                        {
                                return _containsListCollection;
                        }
                }
-
+               */
 
                /// <summary>
-               /// Commits all the changes made to this table since the last time AcceptChanges was called.
+               /// Commits all the changes made to this table since the 
+               /// last time AcceptChanges was called.
                /// </summary>
                
                public void AcceptChanges()
@@ -397,7 +420,9 @@ namespace System.Data
                }
 
                /// <summary>
-               /// Begins the initialization of a DataTable that is used on a form or used by another component. The initialization occurs at runtime.
+               /// Begins the initialization of a DataTable that is used 
+               /// on a form or used by another component. The initialization
+               /// occurs at runtime.
                /// </summary>
                
                public void BeginInit()
@@ -405,7 +430,8 @@ namespace System.Data
                }
 
                /// <summary>
-               /// Turns off notifications, index maintenance, and constraints while loading data.
+               /// Turns off notifications, index maintenance, and 
+               /// constraints while loading data.
                /// </summary>
                
                public void BeginLoadData()
@@ -421,7 +447,8 @@ namespace System.Data
                }
 
                /// <summary>
-               /// Clones the structure of the DataTable, including all DataTable schemas and constraints.
+               /// Clones the structure of the DataTable, including
+               ///  all DataTable schemas and constraints.
                /// </summary>
                
                public virtual DataTable Clone()
@@ -430,7 +457,8 @@ namespace System.Data
                }
 
                /// <summary>
-               /// Computes the given expression on the current rows that pass the filter criteria.
+               /// Computes the given expression on the current rows that 
+               /// pass the filter criteria.
                /// </summary>
                
                public object Compute(string expression, string filter)
@@ -449,7 +477,9 @@ namespace System.Data
                }
 
                /// <summary>
-               /// Ends the initialization of a DataTable that is used on a form or used by another component. The initialization occurs at runtime.
+               /// Ends the initialization of a DataTable that is used 
+               /// on a form or used by another component. The 
+               /// initialization occurs at runtime.
                /// </summary>
                
                public void EndInit()
@@ -457,7 +487,8 @@ namespace System.Data
                }
 
                /// <summary>
-               /// Turns on notifications, index maintenance, and constraints after loading data.
+               /// Turns on notifications, index maintenance, and 
+               /// constraints after loading data.
                /// </summary>
                
                public void EndLoadData()
@@ -465,7 +496,9 @@ namespace System.Data
                }
 
                /// <summary>
-               /// Gets a copy of the DataTable that contains all changes made to it since it was loaded or AcceptChanges was last called.
+               /// Gets a copy of the DataTable that contains all
+               ///  changes made to it since it was loaded or 
+               ///  AcceptChanges was last called.
                /// </summary>
                
                public DataTable GetChanges()
@@ -474,7 +507,9 @@ namespace System.Data
                }
 
                /// <summary>
-               /// Gets a copy of the DataTable containing all changes made to it since it was last loaded, or since AcceptChanges was called, filtered by DataRowState.
+               /// Gets a copy of the DataTable containing all 
+               /// changes made to it since it was last loaded, or 
+               /// since AcceptChanges was called, filtered by DataRowState.
                /// </summary>
                
                public DataTable GetChanges(DataRowState rowStates)
@@ -492,7 +527,8 @@ namespace System.Data
                //}
 
                /// <summary>
-               /// This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
+               /// This member supports the .NET Framework infrastructure
+               /// and is not intended to be used directly from your code.
                /// </summary>
                
                //protected virtual Type GetRowType()
@@ -500,17 +536,21 @@ namespace System.Data
                //}
 
                /// <summary>
-               /// This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
+               /// This member supports the .NET Framework infrastructure 
+               /// and is not intended to be used directly from your code.
                /// </summary>
                
-               IList IListSource.GetList()
+               /* FIXME: implement IListSource
+               public IList IListSource.GetList()
                {
                        IList list = null;
                        return list;
                }
-
+               */
+               
                /// <summary>
-               /// Copies a DataRow into a DataTable, preserving any property settings, as well as original and current values.
+               /// Copies a DataRow into a DataTable, preserving any 
+               /// property settings, as well as original and current values.
                /// </summary>
                
                public void ImportRow(DataRow row)
@@ -518,7 +558,8 @@ namespace System.Data
                }
 
                /// <summary>
-               /// This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
+               /// This member supports the .NET Framework infrastructure
+               ///  and is not intended to be used directly from your code.
                /// </summary>
                
                void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
@@ -526,7 +567,8 @@ namespace System.Data
                }
 
                /// <summary>
-               /// Finds and updates a specific row. If no matching row is found, a new row is created using the given values.
+               /// Finds and updates a specific row. If no matching row
+               ///  is found, a new row is created using the given values.
                /// </summary>
                public DataRow LoadDataRow(object[] values, bool fAcceptChanges)
                {
@@ -544,7 +586,8 @@ namespace System.Data
                }
 
                /// <summary>
-               /// This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
+               /// This member supports the .NET Framework infrastructure
+               ///  and is not intended to be used directly from your code.
                /// </summary>
                protected internal DataRow[] NewRowArray(int size)
                {
@@ -627,7 +670,9 @@ namespace System.Data
                }
 
                /// <summary>
-               /// Rolls back all changes that have been made to the table since it was loaded, or the last time AcceptChanges was called.
+               /// Rolls back all changes that have been made to the 
+               /// table since it was loaded, or the last time AcceptChanges
+               ///  was called.
                /// </summary>
                
                public void RejectChanges()
@@ -653,7 +698,9 @@ namespace System.Data
                }
 
                /// <summary>
-               /// Gets an array of all DataRow objects that match the filter criteria in order of primary key (or lacking one, order of addition.)
+               /// Gets an array of all DataRow objects that match 
+               /// the filter criteria in order of primary key (or 
+               /// lacking one, order of addition.)
                /// </summary>
                
                public DataRow[] Select(string filterExpression)
@@ -663,7 +710,9 @@ namespace System.Data
                }
 
                /// <summary>
-               /// Gets an array of all DataRow objects that match the filter criteria, in the the specified sort order.
+               /// Gets an array of all DataRow objects that 
+               /// match the filter criteria, in the the 
+               /// specified sort order.
                /// </summary>
                
                public DataRow[] Select(string filterExpression, string sort)
@@ -673,7 +722,9 @@ namespace System.Data
                }
 
                /// <summary>
-               /// Gets an array of all DataRow objects that match the filter in the order of the sort, that match the specified state.
+               /// Gets an array of all DataRow objects that match
+               /// the filter in the order of the sort, that match 
+               /// the specified state.
                /// </summary>
                
                public DataRow[] Select(string filterExpression, string sort, DataViewRowState recordStates)
@@ -683,7 +734,8 @@ namespace System.Data
                }
 
                /// <summary>
-               /// Gets the TableName and DisplayExpression, if there is one as a concatenated string.
+               /// Gets the TableName and DisplayExpression, if 
+               /// there is one as a concatenated string.
                /// </summary>
                
                public override string ToString()
@@ -694,13 +746,15 @@ namespace System.Data
                /* FIXME: temporarily commented - so we can get a
                 *        a simple forward read only result set
                /// <summary>
-               /// Occurs when after a value has been changed for the specified DataColumn in a DataRow.
+               /// Occurs when after a value has been changed for 
+               /// the specified DataColumn in a DataRow.
                /// </summary>
                
                public event DataColumnChangeEventHandler ColumnChanged;
 
                /// <summary>
-               /// Occurs when a value is being changed for the specified DataColumn in a DataRow.
+               /// Occurs when a value is being changed for the specified 
+               /// DataColumn in a DataRow.
                /// </summary>
                
                public event DataColumnChangeEventHandler ColumnChanging;
index 35c4479e769b2185941d47eee945e7e8c6507d4f..7dd35cd67ee747e3b408ccd350ed217d75a830bc 100644 (file)
@@ -8,6 +8,8 @@
 //
 
 using System;
+using System.Collections;
+using System.ComponentModel;
 
 namespace System.Data
 {
@@ -55,7 +57,6 @@ namespace System.Data
                }
 
                [MonoTODO]
-               [Serializable]
                public bool CanRemove (DataTable table) {
                        throw new NotImplementedException ();
                }
@@ -75,10 +76,6 @@ namespace System.Data
                        return false;
                }
 
-               public void CopyTo (Array ar, int index) {
-                       Array.Copy (tables, ar, size);
-               }
-
                public virtual int IndexOf (DataTable table) {
                        for (int i = 0; i < size; i++) {
                                if (tables[i] == table)
@@ -135,26 +132,28 @@ namespace System.Data
                                return null;
                        }
                }
-
-               [MonoTODO]
+\r
                protected override ArrayList List {
-                       throw new NotImplementedException ();
+                       [MonoTODO]
+                       get{
+                               throw new NotImplementedException ();
+                       }
                }
                
-               [Serializable]
                public event CollectionChangeEventHandler CollectionChanged;
 
-               [Serializable]
                public event CollectionChangeEventHandler CollectionChanging;
 
-               [Serializable]
                protected virtual void OnCollectionChanged (
                        CollectionChangeEventArgs ccevent) {
+
+                       throw new NotImplementedException ();
                }
 
-               [Serializable]
                protected internal virtual void OnCollectionChanging (
                        CollectionChangeEventArgs ccevent) {
+
+                       throw new NotImplementedException ();
                }
        }
 }
diff --git a/mcs/class/System.Data/System.Data/DataTableRelationCollection.cs b/mcs/class/System.Data/System.Data/DataTableRelationCollection.cs
new file mode 100644 (file)
index 0000000..29e1847
--- /dev/null
@@ -0,0 +1,351 @@
+//
+// System.Data.DataTableRelationCollection.cs
+//
+// Author:
+//   Christopher Podurgiel (cpodurgiel@msn.com)
+//
+// (C) Chris Podurgiel
+//
+
+using System;
+using System.Collections;
+using System.ComponentModel;
+
+namespace System.Data
+{
+       /// <summary>
+       /// Summary description for DataTableRelationCollection.
+       /// </summary>
+       internal class DataTableRelationCollection : DataRelationCollection
+       {
+               private ArrayList list = null;
+               private int defaultNameIndex;
+               private DataTable table;
+               
+
+               /// <summary>
+               /// Initializes a new instance of the DataRelationCollection class.
+               /// </summary>
+               [MonoTODO]
+               internal DataTableRelationCollection():base()
+               {
+                       //table = dataTable;
+               }
+
+               /// <summary>
+               /// Gets the DataRelation object specified by name.
+               /// </summary>
+               [MonoTODO]
+               public override DataRelation this[string name]
+               {
+                       get
+                       {
+                               foreach (DataRelation dataRelation in list)
+                               {
+                                       if (dataRelation.RelationName == name)
+                                       {
+                                               return dataRelation;
+                                       }
+                               }
+
+                               return null;
+                       }
+               }
+
+               /// <summary>
+               /// Gets the DataRelation object at the specified index.
+               /// </summary>
+               [MonoTODO]
+               public override DataRelation this[int index]
+               {
+                       get
+                       {
+                               return (DataRelation)list[index];
+                       }
+               }
+
+               /*
+               #region Add Methods
+               /// <summary>
+               /// Adds a DataRelation to the DataRelationCollection.
+               /// </summary>
+               /// <param name="relation">The DataRelation to add to the collection.</param>
+               public new void Add(DataRelation relation)
+               {
+                       if(relation != null)
+                       {
+                               //CollectionChangeEventArgs e = new CollectionChangeEventArgs(CollectionChangeAction.Add, this);
+                               list.Add(relation);
+                               //OnCollectionChanged(e);
+                       }
+                       return;
+               }
+
+               /// <summary>
+               /// Creates a relation given the parameters and adds it to the collection. The name is defaulted.
+               /// An ArgumentException is generated if this relation already belongs to this collection or belongs to another collection.
+               /// An InvalidConstraintException is generated if the relation can't be created based on the parameters.
+               /// The CollectionChanged event is fired if it succeeds.
+               /// </summary>
+               /// <param name="parentColumn">parent column of relation.</param>
+               /// <param name="childColumn">child column of relation.</param>
+               /// <returns>The created DataRelation.</returns>
+               public override DataRelation Add(DataColumn parentColumn, DataColumn childColumn)
+               {       
+                       if(parentColumn == null)
+                       {
+                               throw new ArgumentNullException("parentColumn");
+                       }
+                       else if( childColumn == null)
+                       {
+                               throw new ArgumentNullException("childColumn");
+                       }
+
+                       if(parentColumn.Table.DataSet != childColumn.Table.DataSet)
+                       {
+                               throw new InvalidConstraintException("my ex");
+                       }
+                       
+                       DataRelation dataRelation = new DataRelation("Relation" + defaultNameIndex.ToString(), parentColumn, childColumn);
+                       list.Add(dataRelation);
+                       defaultNameIndex++;
+                       return dataRelation;
+               }
+
+               /// <summary>
+               /// Creates a relation given the parameters and adds it to the collection. The name is defaulted.
+               /// An ArgumentException is generated if this relation already belongs to this collection or belongs to another collection.
+               /// An InvalidConstraintException is generated if the relation can't be created based on the parameters.
+               /// The CollectionChanged event is raised if it succeeds.
+               /// </summary>
+               /// <param name="parentColumns">An array of parent DataColumn objects.</param>
+               /// <param name="childColumns">An array of child DataColumn objects.</param>
+               /// <returns>The created DataRelation.</returns>
+               public override DataRelation Add(DataColumn[] parentColumns, DataColumn[] childColumns)
+               {
+                       DataRelation dataRelation = new DataRelation("Relation" + defaultNameIndex.ToString(), parentColumns, childColumns);
+                       list.Add(dataRelation);
+                       defaultNameIndex++;
+                       return dataRelation;
+               }
+
+               /// <summary>
+               /// Creates a relation given the parameters and adds it to the collection.
+               /// An ArgumentException is generated if this relation already belongs to this collection or belongs to another collection.
+               /// A DuplicateNameException is generated if this collection already has a relation with the same name (case insensitive).
+               /// An InvalidConstraintException is generated if the relation can't be created based on the parameters.
+               /// The CollectionChanged event is raised if it succeeds.
+               /// </summary>
+               /// <param name="name">The name of the relation.</param>
+               /// <param name="parentColumn">parent column of relation.</param>
+               /// <returns>The created DataRelation.</returns>
+               /// <returns></returns>
+               public override DataRelation Add(string name, DataColumn parentColumn, DataColumn childColumn)
+               {
+                       //If no name was supplied, give it a default name.
+                       if ((name == null) || (name == ""))
+                       {
+                               name = "Relation" + defaultNameIndex.ToString();
+                               defaultNameIndex++;
+                       }
+
+                       DataRelation dataRelation = new DataRelation(name, parentColumn, childColumn);
+                       list.Add(dataRelation);
+                       return dataRelation;
+               }
+
+               /// <summary>
+               /// Creates a DataRelation with the specified name, and arrays of parent and child columns, and adds it to the collection.
+               /// </summary>
+               /// <param name="name">The name of the DataRelation to create.</param>
+               /// <param name="parentColumns">An array of parent DataColumn objects.</param>
+               /// <param name="childColumns">An array of child DataColumn objects.</param>
+               /// <returns>The created DataRelation.</returns>
+               public override DataRelation Add(string name, DataColumn[] parentColumns, DataColumn[] childColumns)
+               {
+                       //If no name was supplied, give it a default name.
+                       if ((name == null) || (name == ""))
+                       {
+                               name = "Relation" + defaultNameIndex.ToString();
+                               defaultNameIndex++;
+                       }
+
+                       DataRelation dataRelation = new DataRelation(name, parentColumns, childColumns);
+                       list.Add(dataRelation);
+                       return dataRelation;
+               }
+
+               /// <summary>
+               /// Creates a relation given the parameters and adds it to the collection.
+               /// An ArgumentException is generated if this relation already belongs to this collection or belongs to another collection.
+               /// A DuplicateNameException is generated if this collection already has a relation with the same name (case insensitive).
+               /// An InvalidConstraintException is generated if the relation can't be created based on the parameters.
+               /// The CollectionChanged event is raised if it succeeds.
+               /// </summary>
+               /// <param name="name">The name of the relation.</param>
+               /// <param name="parentColumn">parent column of relation.</param>
+               /// <param name="childColumn">child column of relation.</param>
+               /// <param name="createConstraints">true to create constraints; otherwise false. (default is true)</param>
+               /// <returns>The created DataRelation.</returns>
+               public override DataRelation Add(string name, DataColumn parentColumn, DataColumn childColumn, bool createConstraints)
+               {
+                       //If no name was supplied, give it a default name.
+                       if ((name == null) || (name == ""))
+                       {
+                               name = "Relation" + defaultNameIndex.ToString();
+                               defaultNameIndex++;
+                       }
+
+                       DataRelation dataRelation = new DataRelation(name, parentColumn, childColumn, createConstraints);
+                       list.Add(dataRelation);
+                       return dataRelation;
+               }
+
+               /// <summary>
+               /// Creates a DataRelation with the specified name, arrays of parent and child columns, 
+               /// and value specifying whether to create a constraint, and adds it to the collection.
+               /// </summary>
+               /// <param name="name">The name of the DataRelation to create.</param>
+               /// <param name="parentColumns">An array of parent DataColumn objects.</param>
+               /// <param name="childColumns">An array of child DataColumn objects.</param>
+               /// <param name="createConstraints">true to create a constraint; otherwise false.</param>
+               /// <returns>The created DataRelation.</returns>
+               public override DataRelation Add(string name, DataColumn[] parentColumns, DataColumn[] childColumns, bool createConstraints)
+               {
+                       //If no name was supplied, give it a default name.
+                       if ((name == null) || (name == ""))
+                       {
+                               name = "Relation" + defaultNameIndex.ToString();
+                               defaultNameIndex++;
+                       }
+
+                       DataRelation dataRelation = new DataRelation(name, parentColumns, childColumns, createConstraints);
+                       list.Add(dataRelation);
+                       return dataRelation;
+               }
+               #endregion
+
+               /// <summary>
+               /// Performs verification on the table.
+               /// </summary>
+               /// <param name="relation">The relation to check.</param>
+               protected virtual void AddCore(DataRelation relation)
+               {
+                       if (relation == null)
+                       {
+                               //TODO: Issue a good exception message.
+                               throw new ArgumentNullException();
+                       }
+                       else if(list.IndexOf(relation) != -1)
+                       {
+                               //TODO: Issue a good exception message.
+                               throw new ArgumentException();
+                       }
+                       else if(list.Contains(relation.RelationName))
+                       {
+                               throw new DuplicateNameException("A Relation named " + relation.RelationName + " already belongs to this DataSet.");
+                       }
+               }
+               */
+
+               /// <summary>
+               /// Copies the elements of the specified DataRelation array to the end of the collection.
+               /// </summary>
+               /// <param name="relations">The array of DataRelation objects to add to the collection.</param>
+               [MonoTODO]
+               public virtual void AddRange(DataRelation[] relations)
+               {
+                       //TODO: Implement.
+
+                       DataSet dataSet = GetDataSet();
+
+                       throw new NotImplementedException ();
+
+                       /*
+                       foreach(DataRelation dataRelation in relations)
+                       {
+                
+                       }
+                       */
+               }
+
+               [MonoTODO]
+               public virtual bool CanRemove(DataRelation relation)
+               {
+                       //TODO: Implement.
+                       return false;
+               }
+
+               [MonoTODO]
+               public virtual void Clear()
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public virtual bool Contains(string name)
+               {
+                       return false;
+               }
+
+               // FIXME: temporarily commented so we can compile
+               /*
+               [MonoTODO]
+               protected override DataSet GetDataSet()
+               {
+                       return table.DataSet;
+               }
+               */
+
+               [MonoTODO]
+               public virtual int IndexOf(DataRelation relation)
+               {
+                       return list.IndexOf(relation);
+               }
+
+               [MonoTODO]
+               public virtual int IndexOf(string relationName)
+               {
+                       return list.IndexOf(this[relationName]);
+               }
+
+               [MonoTODO]
+               protected virtual void OnCollectionChanged(CollectionChangeEventArgs ccevent)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               protected internal virtual void OnCollectionChanging(CollectionChangeEventArgs ccevent)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public void Remove(DataRelation relation)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public void Remove(string name)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public void RemoveAt(int index)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               protected virtual void RemoveCore(DataRelation relation)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               public event CollectionChangeEventHandler CollectionChanged;
+
+       }
+}
diff --git a/mcs/class/System.Data/System.Data/ForeignKeyConstraint.cs b/mcs/class/System.Data/System.Data/ForeignKeyConstraint.cs
new file mode 100644 (file)
index 0000000..591398a
--- /dev/null
@@ -0,0 +1,137 @@
+//
+// System.Data.ForeignKeyConstraint.cs
+//
+// Author:
+//   Daniel Morgan <danmorg@sc.rr.com>
+//
+// (C) 2002 Daniel Morgan
+//
+
+using System;
+using System.Collections;
+using System.ComponentModel;
+using System.Runtime.InteropServices;
+
+namespace System.Data
+{
+
+       [Serializable]\r
+       public class ForeignKeyConstraint : Constraint {
+
+               #region Constructors
+
+               [MonoTODO]\r
+               public ForeignKeyConstraint(DataColumn parentColumn, \r
+                       DataColumn childColumn) {
+               }
+
+               [MonoTODO]\r
+               public ForeignKeyConstraint(DataColumn[] parentColumns,\r
+                       DataColumn[] childColumns) {
+               }
+
+               [MonoTODO]\r
+               public ForeignKeyConstraint(string constraintName,\r
+                       DataColumn parentColumn, DataColumn childColumn) {
+               }
+
+               [MonoTODO]\r
+               public ForeignKeyConstraint(string constraintName,\r
+                       DataColumn[] parentColumns, \r
+                       DataColumn[] childColumns) {
+               }
+
+               [MonoTODO]\r
+               public ForeignKeyConstraint(string constraintName,\r
+                       string parentTableName, string[] parentColumnNames,\r
+                       string[] childColumnNames, \r
+                       AcceptRejectRule acceptRejectRule, Rule deleteRule,\r
+                       Rule updateRule) {
+               }
+
+               #endregion // Constructors
+
+               #region Properites
+\r
+               public virtual AcceptRejectRule AcceptRejectRule {
+                       [MonoTODO]
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       
+                       [MonoTODO]
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+\r
+               public virtual DataColumn[] Columns {
+                       [MonoTODO]
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+\r
+               public virtual Rule DeleteRule {
+                       [MonoTODO]
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       
+                       [MonoTODO]
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+\r
+               public virtual DataColumn[] RelatedColumns {
+                       [MonoTODO]
+                       get {   
+                               throw new NotImplementedException ();
+                       }
+               }\r
+\r
+               public virtual DataTable RelatedTable {
+                       [MonoTODO]
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+\r
+               public override DataTable Table {
+                       [MonoTODO]
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+\r
+               public virtual Rule UpdateRule {
+                       [MonoTODO]
+                       get {
+                               throw new NotImplementedException ();
+                       }
+                       
+                       [MonoTODO]
+                       set {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               [MonoTODO]\r
+               public override bool Equals(object key) {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]\r
+               public override int GetHashCode() {
+                       throw new NotImplementedException ();
+               }
+
+               #endregion // Methods
+       }
+
+}
index e079dd11ebcb2d264628971463690182bccc8733..547d702af67b9fbc208e474673b7714c6ac70e69 100644 (file)
@@ -22,18 +22,14 @@ namespace System.Data
                
                int ExecuteNonQuery();
 
-               // FIXME: temporarily commented so i could 
-               //        compile SqlConnection and SqlCommand
-               /*
                IDataReader ExecuteReader();
 
                IDataReader ExecuteReader(CommandBehavior behavior);
-               */
+
                object ExecuteScalar();
 
                void Prepare();
 
-
                string CommandText{get; set;}
 
                int CommandTimeout{get; set;}
index c400d5746b84e3478b36fa8bfa8cd7c1a8822738..6de239f8cd00a7df480a47167da8b2bcfa421efb 100644 (file)
@@ -65,6 +65,7 @@ namespace System.Data
                        [MonoTODO]
                        get {
                                // FIXME: how do we sync?       
+                               throw new NotImplementedException ();
                        }
                }
 
@@ -82,7 +83,7 @@ namespace System.Data
 
                [MonoTODO]
                public IEnumerator GetEnumerator() {
-
+                       throw new NotImplementedException ();
                }
 
                //[MonoTODO]
index 011c4fd2cd949852d7e4812e7873fb4c4eee7b9d..ef720923387e6c400e44c19f3c85acfbbcd7cc13 100644 (file)
@@ -9,6 +9,7 @@
 
 using System;
 using System.Collections;
+using System.ComponentModel;
 
 namespace System.Data
 {
diff --git a/mcs/class/System.Data/System.Data/UniqueConstraint.cs b/mcs/class/System.Data/System.Data/UniqueConstraint.cs
new file mode 100644 (file)
index 0000000..60ec2e9
--- /dev/null
@@ -0,0 +1,119 @@
+//
+// System.Data.UniqueConstraint.cs
+//
+// Author:
+//   Daniel Morgan <danmorg@sc.rr.com>
+//
+// (C) 2002 Daniel Morgan
+//
+
+using System;
+using System.Collections;
+using System.ComponentModel;
+using System.Runtime.InteropServices;
+
+namespace System.Data
+{
+       public class UniqueConstraint : Constraint {
+
+               #region Constructors
+
+               [MonoTODO]\r
+               public UniqueConstraint(DataColumn column) {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public UniqueConstraint(DataColumn[] columns) {
+
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public UniqueConstraint(DataColumn column,\r
+                       bool isPrimaryKey) {
+
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public UniqueConstraint(DataColumn[] columns, bool isPrimaryKey) {
+
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public UniqueConstraint(string name, DataColumn column) {
+
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public UniqueConstraint(string name, DataColumn[] columns) {
+
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public UniqueConstraint(string name, DataColumn column,\r
+                       bool isPrimaryKey) {
+
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public UniqueConstraint(string name,\r
+                       DataColumn[] columns, bool isPrimaryKey) {
+
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public UniqueConstraint(string name,\r
+                       string[] columnNames, bool isPrimaryKey) {
+
+                       throw new NotImplementedException ();
+               }
+
+               #endregion // Constructors
+               
+               #region Properties
+
+               public virtual DataColumn[] Columns {
+                       [MonoTODO]
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public bool IsPrimaryKey {
+                       [MonoTODO]
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               public override DataTable Table {
+                       [MonoTODO]
+                       get {
+                               throw new NotImplementedException ();
+                       }
+               }
+
+               #endregion // Properties
+
+               #region Methods
+
+               [MonoTODO]
+               public override bool Equals(object key2) {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoTODO]
+               public override int GetHashCode() {
+                       throw new NotImplementedException ();
+               }
+
+               #endregion // Methods
+       }
+}
index b2c94a8842e0832aa8667a74b5382809d80357de..fa02caba7cbeeebfefc2d6a83cca33e32d6194b4 100644 (file)
@@ -1,17 +1,21 @@
 System.Data TODO List
 =====================
 
-This TODO list last updated on 2002-04-23
-
 Update this file as needed...
 
 * To get ExecuteReader() in a SqlCommand object to return 
   a SqlDataReader object which can Read() data and get a String or
   Int32 from the database.  Other types can be done later.
-
-In order to do this, we need to compile 
-       SqlDataReader 
-       DataTable
+  
+  A class (SqlDataReader) that implements IDataReader/IDataRecord
+  only has one row in memory at a time.
+
+In order to do this, we need to compile and edit these classes:
+       SqlDataReader   DataTable       DataRowCollection               DataRow
+                                                               DataColumnCollection    DataColumn
+                                                               DataConstraintCollection DataConstraint
+                                                               DataRelationCollection  DataRelation
+                                                               DataTableCollection
        and dependencies...
 
 System.Data.Common classes that need to be implemented:
@@ -30,9 +34,13 @@ The following classes implement InternalDataCollectionBase:
        * DataRowCollection
        * DataColumnCollection
        * DataTableCollection
-       * DataRelationCollection
+       * DataRelationCollection - an abstract class used by DataTable and DataSet
        * ConstraintCollection
 
+DataTableRelationCollection is an internal class that implements DataRelationCollection
+and is used by DataTable for parent/child relations.  Don't know if it will/will not
+be used by DataSet.
+
 Other classes, structs, etc. that are missing:
        DataRowView
        DataSysDescriptionAttribute
@@ -40,9 +48,7 @@ Other classes, structs, etc. that are missing:
        DataViewSetting
        DataViewSettingCollection
        FillErrorEventArgs
-       ForeignKeyConstraint
        MergeFailedEventArgs
-       UniqueConstraint
        TypedDataSetGenerator
 
 Exceptions that still need to be stubbed: