2002-05-11 Rodrigo Moya <rodrigo@ximian.com>
[mono.git] / mcs / class / System.Data / System.Data / DataRow.cs
index 6a2814e606b25826220e60546a34209dfc3ef661..45ed449db8160104ab5da91ce336fe414d19c346 100644 (file)
@@ -21,16 +21,17 @@ namespace System.Data
        {
                #region Fields
 
-               private ArrayList columns = new ArrayList();
-               private ArrayList columnNames = new ArrayList();
+               private ArrayList columns = new ArrayList ();
+               private ArrayList columnNames = new ArrayList ();
                private DataTable table = null;
+               private DataRowState rowState = DataRowState.Unchanged;
 
                #endregion
 
                #region Methods
 
                [MonoTODO]
-               public void AcceptChanges() {
+               public void AcceptChanges () {
                        throw new NotImplementedException ();
                }
 
@@ -41,7 +42,8 @@ namespace System.Data
 
                [MonoTODO]
                public void CancelEdit() {
-                       throw new NotImplementedException ();
+                       // FIXME: throw changes away
+                       rowState = DataRowState.Unchanged;
                }
 
                [MonoTODO]
@@ -49,9 +51,8 @@ namespace System.Data
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
                public void Delete() {
-                       throw new NotImplementedException ();
+                       rowState = DataRowState.Deleted;
                }
 
                [MonoTODO]
@@ -60,142 +61,142 @@ namespace System.Data
                }
 
                [MonoTODO]
-               public DataRow[] GetChildRows(DataRelation dr) {
+               public DataRow[] GetChildRows (DataRelation dr) {
                        throw new NotImplementedException ();
                }
 
                [MonoTODO]
-               public DataRow[] GetChildRows(string s) {
+               public DataRow[] GetChildRows (string s) {
                        throw new NotImplementedException ();
                }
 
                [MonoTODO]
-               public DataRow[] GetChildRows(DataRelation dr, DataRowVersion version) {
+               public DataRow[] GetChildRows (DataRelation dr, DataRowVersion version) {
                        throw new NotImplementedException ();
                }
 
                [MonoTODO]
-               public DataRow[] GetChildRows(string s, DataRowVersion version) {
+               public DataRow[] GetChildRows (string s, DataRowVersion version) {
                        throw new NotImplementedException ();
                }
 
                [MonoTODO]
-               public string GetColumnError(DataColumn col) {
+               public string GetColumnError (DataColumn col) {
                        throw new NotImplementedException ();
                }
 
                [MonoTODO]
-               public string GetColumnError(int index) {
+               public string GetColumnError (int index) {
                        throw new NotImplementedException ();
                }
 
                [MonoTODO]
-               public string GetColumnError(string s) {
+               public string GetColumnError (string s) {
                        throw new NotImplementedException ();
                }
 
                [MonoTODO]
-               public DataColumn[] GetColumnsInError() {
+               public DataColumn[] GetColumnsInError () {
                        throw new NotImplementedException ();
                }
 
                [MonoTODO]
-               public DataRow GetParentRow(DataRelation dr) {
+               public DataRow GetParentRow (DataRelation dr) {
                        throw new NotImplementedException ();
                }
 
                [MonoTODO]
-               public DataRow GetParentRow(string s) {
+               public DataRow GetParentRow (string s) {
                        throw new NotImplementedException ();
                }
 
                [MonoTODO]
-               public DataRow GetParentRow(DataRelation dr, DataRowVersion version) {
+               public DataRow GetParentRow (DataRelation dr, DataRowVersion version) {
                        throw new NotImplementedException ();
                }
 
                [MonoTODO]
-               public DataRow GetParentRow(string s, DataRowVersion version) {
+               public DataRow GetParentRow (string s, DataRowVersion version) {
                        throw new NotImplementedException ();
                }
 
                [MonoTODO]
-               public DataRow[] GetParentRows(DataRelation dr) {
+               public DataRow[] GetParentRows (DataRelation dr) {
                        throw new NotImplementedException ();
                }
 
                [MonoTODO]
-               public DataRow[] GetParentRows(string s) {
+               public DataRow[] GetParentRows (string s) {
                        throw new NotImplementedException ();
                }
 
                [MonoTODO]
-               public DataRow[] GetParentRows(DataRelation dr, DataRowVersion version) {
+               public DataRow[] GetParentRows (DataRelation dr, DataRowVersion version) {
                        throw new NotImplementedException ();
                }
 
                [MonoTODO]
-               public DataRow[] GetParentRows(string s, DataRowVersion version) {
+               public DataRow[] GetParentRows (string s, DataRowVersion version) {
                        throw new NotImplementedException ();
                }
 
                [MonoTODO]
-               public bool HasVersion(DataRowVersion version) {
+               public bool HasVersion (DataRowVersion version) {
                        throw new NotImplementedException ();
                }
 
                [MonoTODO]
-               public bool IsNull(DataColumn dc) {
+               public bool IsNull (DataColumn dc) {
                        throw new NotImplementedException ();
                }
 
                [MonoTODO]
-               public bool IsNull(int i) {
+               public bool IsNull (int i) {
                        throw new NotImplementedException ();
                }
 
                [MonoTODO]
-               public bool IsNull(string s) {
+               public bool IsNull (string s) {
                        throw new NotImplementedException ();
                }
 
                [MonoTODO]
-               public bool IsNull(DataColumn dc, DataRowVersion version) {
+               public bool IsNull (DataColumn dc, DataRowVersion version) {
                        throw new NotImplementedException ();
                }
 
                [MonoTODO]
-               public void RejectChanges() {
-                       throw new NotImplementedException ();
+               public void RejectChanges () {
+                       CancelEdit ();
                }
 
                [MonoTODO]
-               public void SetColumnError(DataColumn dc, string err) {
+               public void SetColumnError (DataColumn dc, string err) {
                        throw new NotImplementedException ();
                }
 
                [MonoTODO]
-               public void SetColumnError(int i, string err) {
+               public void SetColumnError (int i, string err) {
                        throw new NotImplementedException ();
                }
 
                [MonoTODO]
-               public void SetColumnError(string a, string err) {
+               public void SetColumnError (string a, string err) {
                        throw new NotImplementedException ();
                }
 
                [MonoTODO]
-               public void SetParentRow(DataRow row) {
+               public void SetParentRow (DataRow row) {
                        throw new NotImplementedException ();
                }
 
                [MonoTODO]
-               public void SetParentRow(DataRow row, DataRelation rel) {
+               public void SetParentRow (DataRow row, DataRelation rel) {
                        throw new NotImplementedException ();
                }
 
                [MonoTODO]
-               protected void SetNull(DataColumn column) {
+               protected void SetNull (DataColumn column) {
                        throw new NotImplementedException ();
                }
                
@@ -205,67 +206,96 @@ namespace System.Data
 
                public bool HasErrors {
                        [MonoTODO]
-                       get { throw new NotImplementedException (); }
+                       get {
+                               throw new NotImplementedException ();
+                       }
                }
 
                public object this[string s] {
                        [MonoTODO]
-                       get { throw new NotImplementedException (); }
+                       get {
+                               throw new NotImplementedException ();
+                       }
 
                        [MonoTODO]
-                       set { throw new NotImplementedException (); }
+                       set {
+                               throw new NotImplementedException ();
+                       }
                }
 
                public object this[DataColumn dc] {
                        [MonoTODO]
-                       get { throw new NotImplementedException (); }
+                       get {
+                               throw new NotImplementedException ();
+                       }
 
                        [MonoTODO]
-                       set { throw new NotImplementedException (); }
+                       set {
+                               throw new NotImplementedException ();
+                       }
                }
 
                public object this[int i] {
                        [MonoTODO]
-                       get { throw new NotImplementedException (); }
+                       get {
+                               throw new NotImplementedException ();
+                       }
 
                        [MonoTODO]
-                       set { throw new NotImplementedException (); }
+                       set {
+                               throw new NotImplementedException ();
+                       }
                }
 
                public object this[string s, DataRowVersion version] {
                        [MonoTODO]
-                       get { throw new NotImplementedException (); }
+                       get {
+                               throw new NotImplementedException ();
+                       }
                }
 
                public object this[DataColumn dc, DataRowVersion version] {
                        [MonoTODO]
-                       get { throw new NotImplementedException (); }
+                       get {
+                               throw new NotImplementedException ();
+                       }
                }
 
                public object this[int i, DataRowVersion version] {
                        [MonoTODO]
-                       get { throw new NotImplementedException (); }
+                       get {
+                               throw new NotImplementedException ();
+                       }
                }
 
                public object[] ItemArray {
                        [MonoTODO]
-                       get { throw new NotImplementedException (); }
+                       get {
+                               throw new NotImplementedException ();
+                       }
 
                        [MonoTODO]
-                       set { throw new NotImplementedException (); }
+                       set {
+                               throw new NotImplementedException ();
+                       }
                }
 
                public string RowError {
                        [MonoTODO]
-                       get { throw new NotImplementedException (); }
+                       get {
+                               throw new NotImplementedException ();
+                       }
 
                        [MonoTODO]
-                       set { throw new NotImplementedException (); }
+                       set {
+                               throw new NotImplementedException ();
+                       }
                }
 
                public DataRowState RowState {
-                       [MonoTODO]
-                       get { throw new NotImplementedException (); }
+                       get {
+                               return rowState;
+                       }
                }
 
                public DataTable Table {