Sfoglia il codice sorgente

2002-11-06 Daniel Morgan <[email protected]>

	* DataColumnPropertyDescriptor.cs: added file

	* System.Data/DataRowView.cs: started implementation

	* DataTable.cs: stubbed more interfaces.  Implemented
	IListSource.GetList()

	* DataView.cs: stubbed more interfaces.  Implemented
	some properties and methods: GetEnumerator(),
	ITypedList.GetItemProperties, Item indexer, CopyTo()

svn path=/trunk/mcs/; revision=8852
Daniel Morgan 23 anni fa
parent
commit
c381db50a2

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

@@ -1,3 +1,16 @@
+2002-11-06  Daniel Morgan <[email protected]>
+
+	* DataColumnPropertyDescriptor.cs: added file
+	
+	* System.Data/DataRowView.cs: started implementation
+	
+	* DataTable.cs: stubbed more interfaces.  Implemented
+	IListSource.GetList()
+	
+	* DataView.cs: stubbed more interfaces.  Implemented
+	some properties and methods: GetEnumerator(), 
+	ITypedList.GetItemProperties, Item indexer, CopyTo()
+
 2002-05-18  Nick Drochak  <[email protected]>
 
 	* DataRow.cs: Fix typo.

+ 1 - 3
mcs/class/System.Data/System.Data/DataColumn.cs

@@ -10,9 +10,9 @@
 // (C) Copyright 2002, Franklin Wise
 // (C) Chris Podurgiel
 // (C) Ximian, Inc 2002
+// (C) Daniel Morgan 2002
 //
 
-
 using System;
 using System.ComponentModel;
 
@@ -20,7 +20,6 @@ namespace System.Data
 {
 	internal delegate void DelegateColumnValueChange(DataColumn column,
 			DataRow row, object proposedValue);
-
 	
 	/// <summary>
 	/// Summary description for DataColumn.
@@ -36,7 +35,6 @@ namespace System.Data
 		//used for FK Constraint Cascading rules
 		internal event DelegateColumnValueChange ColumnValueChanging;
 		#endregion //Events
-
 		
 		#region Fields
 

+ 2 - 11
mcs/class/System.Data/System.Data/DataColumnCollection.cs

@@ -17,11 +17,9 @@ namespace System.Data
 	/// <summary>
 	/// Represents a collection of DataColumn objects for a DataTable.
 	/// </summary>
+	[Serializable]
 	public class DataColumnCollection : InternalDataCollectionBase
 	{
-		
-
-		
 		// The defaultNameIndex is used to create a default name for a column if one wasn't given.
 		private int defaultNameIndex;
 
@@ -35,8 +33,6 @@ namespace System.Data
 			parentTable = table;
 		}
 
-
-
 		/// <summary>
 		/// Gets the DataColumn from the collection at the specified index.
 		/// </summary>
@@ -62,13 +58,10 @@ namespace System.Data
 						return column;
 					}
 				}
-
-				return null;
-                
+				return null;                
 			}
 		}
 
-
 		/// <summary>
 		/// Gets a list of the DataColumnCollection items.
 		/// </summary>
@@ -80,7 +73,6 @@ namespace System.Data
 			}
 		}
 
-
 		//Add Logic
 		//
 		//Changing Event
@@ -457,6 +449,5 @@ namespace System.Data
 		/// Occurs when the columns collection changes, either by adding or removing a column.
 		/// </summary>
 		public event CollectionChangeEventHandler CollectionChanged;
-
 	}
 }

+ 129 - 0
mcs/class/System.Data/System.Data/DataColumnPropertyDescriptor.cs

@@ -0,0 +1,129 @@
+//
+// System.Data.DataColumnPropertyDescriptor.cs
+//
+// Author:
+//   Daniel Morgan <[email protected]>
+//
+// (c) copyright 2002 Daniel Morgan
+//
+
+using System;
+using System.ComponentModel;
+using System.Reflection;
+
+namespace System.Data 
+{
+	public class DataColumnPropertyDescriptor : PropertyDescriptor 
+	{
+		private bool readOnly = true;
+		private Type componentType = null;
+		private Type propertyType = null;
+		private PropertyInfo prop = null;
+
+		public DataColumnPropertyDescriptor (string name, Attribute [] attrs)
+			: base (name, attrs) 
+		{
+		}
+
+		public void SetReadOnly (bool value) 
+		{
+			readOnly = value;
+		}
+		
+		public void SetComponentType (Type type) 
+		{
+			componentType = type;
+		}
+
+		public void SetPropertyType (Type type) 
+		{
+			propertyType = type;
+		}
+
+		private PropertyInfo GetPropertyInfo () 
+		{
+			string defaultMemberName = "";
+			object[] attribs = componentType.GetCustomAttributes (true);
+						
+			for (int at = 0; at < attribs.Length; at++) {
+				if (attribs[at] is DefaultMemberAttribute) {
+					defaultMemberName = ((DefaultMemberAttribute) attribs[at]).MemberName;
+					break;
+				}
+			}
+
+			// FIXME: what do I do if a DefaultMemeberAttribute is not found?
+			//        should I try looking for DefaultPropertyAttribute?
+			if (defaultMemberName.Equals(""))
+				throw new Exception("Default property not found.");
+
+			Type[] parmTypes = new Type[1];
+			parmTypes[0] = propertyType;
+			PropertyInfo propertyInfo = componentType.GetProperty (defaultMemberName, parmTypes);
+			return propertyInfo;
+		}
+
+		public override object GetValue (object component) 
+		{
+			if (prop == null)
+				prop = GetPropertyInfo ();		
+							
+			// FIXME: should I allow multiple parameters?											
+			object[] parms = new object[1];
+			parms[0] = base.Name;
+			return prop.GetValue (component, parms);
+		}
+
+		public override void SetValue(object component,	object value) 
+		{
+			if (prop == null)
+				prop = GetPropertyInfo ();		
+
+			if (readOnly == true) {
+				// FIXME: what really happens if read only?
+				throw new Exception("Property is ReadOnly");
+			}
+			
+			// FIXME: should I allow multiple parameters?
+			object[] parms = new Object[1];
+			parms[0] = base.Name;
+			prop.SetValue (component, value, parms);
+		}
+
+		[MonoTODO]
+		public override void ResetValue(object component) 
+		{
+			throw new NotImplementedException ();
+		}
+
+		[MonoTODO]
+		public override bool CanResetValue(object component) 
+		{
+			throw new NotImplementedException ();
+		}
+
+		[MonoTODO]
+		public override bool ShouldSerializeValue(object component) 
+		{
+			throw new NotImplementedException ();
+		}
+
+		public override Type ComponentType {
+			get {
+				return componentType;
+			}
+		}
+
+		public override bool IsReadOnly {
+			get {
+				return readOnly;	
+			}
+		}
+
+		public override Type PropertyType {
+			get {
+				return propertyType;
+			}
+		}
+	}
+}

+ 1 - 0
mcs/class/System.Data/System.Data/DataRowCollection.cs

@@ -7,6 +7,7 @@
 //
 // (C) Ximian, Inc 2002
 // (C) Copyright 2002 Tim Coleman
+// (C) Copyright 2002 Daniel Morgan
 //
 
 using System;

+ 82 - 19
mcs/class/System.Data/System.Data/DataRowView.cs

@@ -4,20 +4,44 @@
 // Author:
 //    Rodrigo Moya <[email protected]>
 //    Miguel de Icaza <[email protected]>
+//    Daniel Morgan <[email protected]>
 //
 // (C) Ximian, Inc 2002
+// (C) Daniel Morgan 2002
 //
 
+using System;
 using System.Collections;
 using System.ComponentModel;
+using System.Reflection;
 
 namespace System.Data
 {
 	/// <summary>
 	/// Represents a customized view of a DataRow exposed as a fully featured Windows Forms control.
 	/// </summary>
+	//[DefaultMember("Item")]
+	[DefaultProperty("Item")]
 	public class DataRowView : ICustomTypeDescriptor, IEditableObject, IDataErrorInfo
 	{
+		#region Fields
+
+		private DataView dataView;
+		private DataRow dataRow;
+
+		#endregion // Fields
+
+		#region Constructors
+
+		internal DataRowView (DataView dataView, int rowIndex) {
+			this.dataView = dataView;
+			this.dataRow = dataView.Table.Rows[rowIndex];
+		}
+
+		#endregion // Constructors
+
+		#region Methods
+
 		[MonoTODO]
 		public void BeginEdit ()
 		{
@@ -53,12 +77,16 @@ namespace System.Data
 		{
 			throw new NotImplementedException ();
 		}
+
+		#endregion // Methods
+
+		#region Properties
 		
 		public DataView DataView
 		{
 			[MonoTODO]
 			get {
-				throw new NotImplementedException ();
+				return dataView;
 			}
 		}
 
@@ -75,15 +103,17 @@ namespace System.Data
 				throw new NotImplementedException ();
 			}
 		}
-
-		public string this[string column] {
+		
+		public object this[string column] {
 			[MonoTODO]
 			get {
-				throw new NotImplementedException ();
+				DataColumn dc = dataView.Table.Columns[column];
+				return dataRow[dc];
 			}
 			[MonoTODO]
 			set {
-				throw new NotImplementedException ();
+				DataColumn dc = dataView.Table.Columns[column];
+				dataRow[dc] = value;
 			}
 		}
 
@@ -96,18 +126,21 @@ namespace System.Data
 		public object this[int column] {
 			[MonoTODO]
 			get {
-				throw new NotImplementedException ();
+				DataColumn dc = dataView.Table.Columns[column];
+				return dataRow[dc];
 			}
 			[MonoTODO]
 			set {
-				throw new NotImplementedException ();
+				DataColumn dc = dataView.Table.Columns[column];
+				dataRow[dc] = value;
+
 			}
 		}
 
 		public DataRow Row {
 			[MonoTODO]
 			get {
-				throw new NotImplementedException ();
+				return dataRow;
 			}
 		}
 
@@ -118,32 +151,38 @@ namespace System.Data
 			}
 		}
 
-		//
-		// ICustomTypeDescriptor implementations
-		//
-
+		#endregion // Properties
+		
+		#region ICustomTypeDescriptor implementations
+		
 		[MonoTODO]
 		AttributeCollection ICustomTypeDescriptor.GetAttributes  ()
 		{
-			throw new NotImplementedException ();
+			System.ComponentModel.AttributeCollection attributes;
+			attributes = AttributeCollection.Empty;
+			return attributes;
+			//object[] attributes = this.GetType ().GetCustomAttributes (true);
+			//AttributeCollection attribCollection;
+			//attribCollection = new AttributeCollection (attributes);
+			//return attribCollection;
 		}
 
 		[MonoTODO]
 		string ICustomTypeDescriptor.GetClassName ()
 		{
-			throw new NotImplementedException ();
+			return "";
 		}
 		
 		[MonoTODO]
 		string ICustomTypeDescriptor.GetComponentName ()
 		{
-			throw new NotImplementedException ();
+			return "";
 		}
 
 		[MonoTODO]
 		TypeConverter ICustomTypeDescriptor.GetConverter ()
 		{
-			throw new NotImplementedException ();
+			return null;
 		}
 
 		[MonoTODO]
@@ -155,7 +194,7 @@ namespace System.Data
 		[MonoTODO]
 		PropertyDescriptor ICustomTypeDescriptor.GetDefaultProperty ()
 		{
-			throw new NotImplementedException ();
+			return null;
 		}
 		
 		[MonoTODO]
@@ -179,13 +218,17 @@ namespace System.Data
 		[MonoTODO]
 		PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties ()
 		{
-			throw new NotImplementedException ();
+			ITypedList typedList = (ITypedList) dataView;
+			return typedList.GetItemProperties(new PropertyDescriptor[0]);
 		}
 
 		[MonoTODO]
 		PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties (Attribute [] attributes)
 		{
-			throw new NotImplementedException ();
+			PropertyDescriptorCollection descriptors;
+			descriptors = ((ICustomTypeDescriptor) this).GetProperties ();
+			// TODO: filter out any Attributes not in the attributes array
+			return descriptors;
 		}
 		
 		[MonoTODO]
@@ -193,5 +236,25 @@ namespace System.Data
 		{
 			throw new NotImplementedException ();
 		}
+
+		#endregion // ICustomTypeDescriptor implementations
+
+		#region IDataErrorInfo implementation
+
+		string IDataErrorInfo.Error {
+			[MonoTODO]
+			get {
+				throw new NotImplementedException();
+			}
+		}
+
+		string IDataErrorInfo.this[string columnName] {
+			[MonoTODO]
+			get {
+				throw new NotImplementedException();
+			}
+		}
+
+		#endregion // IDataErrorInfo implementation
 	}
 }

+ 16 - 15
mcs/class/System.Data/System.Data/DataTable.cs

@@ -22,9 +22,9 @@ namespace System.Data
 	/// <summary>
 	/// Represents one table of in-memory data.
 	/// </summary>
-	[Serializable]
-	public class DataTable : ISerializable
-                //MarshalByValueComponent, IListSource, ISupportInitialize
+	[Serializable]
+	public class DataTable : MarshalByValueComponent, IListSource,
+		ISupportInitialize, ISerializable	
 	{
 		internal DataSet dataSet;   
 		
@@ -341,7 +341,7 @@ namespace System.Data
 		/// for the DataTable.
 		/// </summary>
 		
-		public virtual ISite Site
+		public override ISite Site
 		{
 			get {
 				return _site;
@@ -364,15 +364,14 @@ namespace System.Data
 				_tableName = value;
 			}
 		}
-
-		/* FIXME: implement IListSource
-		public bool IListSource.ContainsListCollection
+		
+		bool IListSource.ContainsListCollection
 		{
 			get {
-				return _containsListCollection;
+				// the collection is a DataView
+				return false;
 			}
 		}
-		*/
 
 		/// <summary>
 		/// Commits all the changes made to this table since the 
@@ -520,16 +519,18 @@ namespace System.Data
 		/// <summary>
 		/// This member supports the .NET Framework infrastructure 
 		/// and is not intended to be used directly from your code.
+		/// 
+		/// Used for Data Binding between System.Web.UI. controls 
+		/// like a DataGrid
+		/// or
+		/// System.Windows.Forms controls like a DataGrid
 		/// </summary>
-		
-		/* FIXME: implement IListSource
-		public IList IListSource.GetList()
+		IList IListSource.GetList()
 		{
-			IList list = null;
+			IList list = (IList) _defaultView;
 			return list;
 		}
-		*/
-		
+				
 		/// <summary>
 		/// Copies a DataRow into a DataTable, preserving any 
 		/// property settings, as well as original and current values.

+ 294 - 21
mcs/class/System.Data/System.Data/DataView.cs

@@ -7,32 +7,46 @@
 // (C) Ximian, Inc 2002
 //
 
+using System;
 using System.Collections;
 using System.ComponentModel;
 
-namespace System.Data
-{
+namespace System.Data {
 	/// <summary>
 	/// A DataView is used in the binding of data between
 	/// a DataTable and Windows Forms or Web Forms allowing
 	/// a view of a DataTable for editing, filtering,
 	/// navigation, searching, and sorting.
 	/// </summary>
-	public class DataView : MarshalByValueComponent, //IBindingList,
-	IEnumerable, // ITypedList, IList, ICollection, 
-		ISupportInitialize {
+	public class DataView : MarshalByValueComponent, IBindingList,
+		IList, ICollection, IEnumerable, ITypedList, ISupportInitialize
+	{
+
+		DataTable dataTable = null;
+		string rowFilter = "";
+		string sort = "";
+		DataViewRowState rowState;
 
 		[MonoTODO]	
-		public DataView() {
+		public DataView () {
+			dataTable = new DataTable ();
+			rowState = DataViewRowState.None;
 		}
 
 		[MonoTODO]
-		public DataView(DataTable table) {
+		public DataView (DataTable table) {
+
+			dataTable = table;
+			rowState = DataViewRowState.None;
 		}
 
 		[MonoTODO]
-		public DataView(DataTable table, string RowFilter,
-			string Sort, DataViewRowState RowState) {
+		public DataView (DataTable table, string RowFilter,
+			string Sort, DataViewRowState RowState) : this (table) {
+			
+			rowFilter = RowFilter;
+			sort = Sort;
+			rowState = RowState;
 		}
 
 		public bool AllowDelete {
@@ -43,6 +57,7 @@ namespace System.Data
 			
 			[MonoTODO]
 			set {
+				throw new NotImplementedException ();
 			}
 		}
 
@@ -54,6 +69,7 @@ namespace System.Data
 			
 			[MonoTODO]
 			set {
+				throw new NotImplementedException ();
 			}
 		}
 
@@ -65,6 +81,7 @@ namespace System.Data
 			
 			[MonoTODO]
 			set {
+				throw new NotImplementedException ();
 			}
 		}
 
@@ -76,13 +93,18 @@ namespace System.Data
 			
 			[MonoTODO]
 			set {
+				throw new NotImplementedException ();
 			}
 		}
 
+		// get the count of rows in the DataView after RowFilter 
+		// and RowStateFilter have been applied
 		public int Count {
 			[MonoTODO]
 			get {
-				throw new NotImplementedException ();
+				// TODO: apply RowFilter
+				// TODO: apply RowStateFilter
+				return dataTable.Rows.Count;				
 			}
 		}
 
@@ -97,7 +119,7 @@ namespace System.Data
 		public DataRowView this[int recordIndex] {
 			[MonoTODO]
 			get {
-				throw new NotImplementedException ();
+				return new DataRowView(this, recordIndex);
 			}
 		}
 
@@ -109,6 +131,7 @@ namespace System.Data
 			
 			[MonoTODO]
 			set {
+				throw new NotImplementedException ();
 			}
 		}
 
@@ -120,6 +143,7 @@ namespace System.Data
 			
 			[MonoTODO]
 			set {
+				throw new NotImplementedException ();
 			}
 		}
 
@@ -131,17 +155,19 @@ namespace System.Data
 			
 			[MonoTODO]
 			set {
+				throw new NotImplementedException ();
 			}
 		}
 
 		public DataTable Table {
 			[MonoTODO]
 			get {
-				throw new NotImplementedException ();
+				return dataTable;
 			}
 			
 			[MonoTODO]
 			set {
+				dataTable = value;
 			}
 		}
 
@@ -152,18 +178,26 @@ namespace System.Data
 
 		[MonoTODO]
 		public void BeginInit() {
+			throw new NotImplementedException ();
 		}
 
 		[MonoTODO]
 		public void CopyTo(Array array,	int index) {
+			// TODO: apply RowFilter
+			// TODO: apply RowStateFilter
+			for (int row = 0; row < dataTable.Rows.Count; row++) {
+				array.SetValue(this[row], index + row);
+			}
 		}
 
 		[MonoTODO]
 		public void Delete(int index) {
+			throw new NotImplementedException ();
 		}
 
 		[MonoTODO]
 		public void EndInit() {
+			throw new NotImplementedException ();
 		}
 
 		[MonoTODO]
@@ -188,7 +222,12 @@ namespace System.Data
 
 		[MonoTODO]
 		public IEnumerator GetEnumerator() {
-			throw new NotImplementedException ();
+			// TODO: apply RowFilter
+			// TODO: apply RowStateFilter
+			DataRowView[] dataRowViews;
+			dataRowViews = new DataRowView[dataTable.Rows.Count];
+			this.CopyTo (dataRowViews, 0);
+			return new DataViewEnumerator (dataRowViews);
 		}
 		
 		[MonoTODO]
@@ -197,37 +236,271 @@ namespace System.Data
 		protected bool IsOpen {
 			[MonoTODO]
 			get {
-			throw new NotImplementedException ();
+				throw new NotImplementedException ();
 			}
 		}
 
 		[MonoTODO]
 		protected void Close() {
+			throw new NotImplementedException ();
 		}
 
 		[MonoTODO]
 		protected virtual void ColumnCollectionChanged(
 			object sender, CollectionChangeEventArgs e) {
+
+			throw new NotImplementedException ();
 		}
 
-		protected override void Dispose (bool disposing)
-		{
+		protected override void Dispose (bool disposing) {
+			
 		}
 
 		[MonoTODO]
-		protected virtual void IndexListChanged(object sender, ListChangedEventArgs e)
-		{
+		protected virtual void IndexListChanged(object sender, ListChangedEventArgs e) {
+			throw new NotImplementedException ();
 		}
 
 		[MonoTODO]
-		protected virtual void OnListChanged(ListChangedEventArgs e)
-		{
+		protected virtual void OnListChanged(ListChangedEventArgs e) {
+			throw new NotImplementedException ();
 		}
 
 		[MonoTODO]
 		protected void Open() {
+			
 		}
+		
+		[MonoTODO]
+		PropertyDescriptorCollection ITypedList.GetItemProperties (
+			PropertyDescriptor[] listAccessors) {
+
+			// FIXME: use listAccessors somehow
+
+			DataColumnPropertyDescriptor[] descriptors = 
+				new DataColumnPropertyDescriptor[dataTable.Columns.Count];
+
+			DataColumnPropertyDescriptor descriptor;
+			DataColumn dataColumn;
+			for(int col = 0; col < dataTable.Columns.Count; col++)
+			{
+				dataColumn = dataTable.Columns[col];
+				
+				descriptor = new DataColumnPropertyDescriptor(
+					dataColumn.ColumnName, null);
+				descriptor.SetComponentType(typeof(System.Data.DataRowView));
+				descriptor.SetPropertyType(dataColumn.DataType);
+				
+				descriptors[col] = descriptor;
+			}
 
-	}
+			return new PropertyDescriptorCollection (descriptors);
+		}
+
+		[MonoTODO]
+		string ITypedList.GetListName (PropertyDescriptor[] listAccessors) {
+			return "";
+		}
+
+		//int ICollection.Count { 
+		//	get {
+		//		return Count;
+		//	} 
+		//}
+
+		bool ICollection.IsSynchronized { 
+			[MonoTODO]
+			get {
+				throw new NotImplementedException ();
+			} 
+		}
+
+		object ICollection.SyncRoot { 
+			[MonoTODO]
+			get {
+				// FIXME:
+				throw new NotImplementedException ();
+			}
+		}
+
+		//void ICollection.CopyTo (Array array, int index) {
+		//	CopyTo (array, index);
+		//}
+
+		bool IList.IsFixedSize {
+			[MonoTODO]
+			get {
+				throw new NotImplementedException ();
+			}
+		}
+		
+		bool IList.IsReadOnly {
+			[MonoTODO]
+			get {
+				throw new NotImplementedException ();
+			}
+		}
+
+		object IList.this[int recordIndex] {
+			get {
+				return this[recordIndex];
+			}
+
+			[MonoTODO]
+			set{
+				// FIXME: throw an exception
+				// because it can not be set
+				throw new InvalidOperationException("Can not set Item property of a DataView");
+			}
+		}
+
+		int IList.Add (object value) {
+			throw new NotImplementedException ();
+		}
+
+		void IList.Clear () {
+			throw new NotImplementedException ();
+		}
+
+		bool IList.Contains (object value) {
+			throw new NotImplementedException ();
+		}
+
+		int IList.IndexOf (object value) {
+			throw new NotImplementedException ();
+		}
+				
+		void IList.Insert(int index,object value) {
+			throw new NotImplementedException ();
+		}
+
+		void IList.Remove(object value) {
+			throw new NotImplementedException ();
+		}
+
+		void IList.RemoveAt(int index) {
+			throw new NotImplementedException ();
+		}
+
+		#region IBindingList implementation
+
+		void IBindingList.AddIndex (PropertyDescriptor property) {
+			throw new NotImplementedException ();
+		}
+
+		object IBindingList.AddNew () {
+			throw new NotImplementedException ();
+		}
+
+		void IBindingList.ApplySort (PropertyDescriptor property, ListSortDirection direction) {
+			throw new NotImplementedException ();
+		}
+
+		int IBindingList.Find (PropertyDescriptor property, object key) {
+			throw new NotImplementedException ();
+		}
+
+		void IBindingList.RemoveIndex (PropertyDescriptor property) {
+			throw new NotImplementedException ();
+		}
+
+		void IBindingList.RemoveSort () {
+			throw new NotImplementedException ();
+		}
+		
+		bool IBindingList.AllowEdit {
+			get {
+				throw new NotImplementedException ();
+			}
+		}
+
+		bool IBindingList.AllowNew {
+			get {
+				throw new NotImplementedException ();
+			}
+		}
+
+		bool IBindingList.AllowRemove {
+			get {
+				throw new NotImplementedException ();
+			}
+		}
+
+		bool IBindingList.IsSorted {
+			[MonoTODO]
+			get {
+				throw new NotImplementedException ();
+			}
+		}
 
+		ListSortDirection IBindingList.SortDirection {
+			[MonoTODO]
+			get {
+				throw new NotImplementedException ();
+			}
+		}
+
+		PropertyDescriptor IBindingList.SortProperty {
+			[MonoTODO]
+			get {
+				throw new NotImplementedException ();
+			}
+		}
+
+		bool IBindingList.SupportsChangeNotification {
+			[MonoTODO]
+			get {
+				throw new NotImplementedException ();
+			}
+		}
+
+		bool IBindingList.SupportsSearching {
+			[MonoTODO]
+			get {
+				throw new NotImplementedException ();
+			}
+		}
+
+		bool IBindingList.SupportsSorting {
+			[MonoTODO]
+			get {
+				throw new NotImplementedException ();
+			}
+		}
+
+		#endregion // IBindingList implementation
+
+		private class DataViewEnumerator : IEnumerator {
+			private DataRowView[] rows;
+			int on = -1;
+
+			internal DataViewEnumerator (DataRowView[] dataRowViews) {
+				rows = dataRowViews;
+			}
+
+			public object Current {
+				get {
+					if(on == rows.Length - 1)
+						throw new InvalidOperationException ();
+					return rows[on];
+				}
+			}
+
+			public bool MoveNext() {
+				// TODO: how do you determine
+				// if a collection has been
+				// changed?
+				if(on < rows.Length - 1) {
+					on++;
+					return true;
+				}
+
+				return false; // EOF
+			}
+
+			public void Reset() {
+				on = -1;
+			}
+		}
+	}
 }

+ 1 - 1
mcs/class/System.Data/System.Data/DataViewManager.cs

@@ -16,7 +16,7 @@ namespace System.Data
 	/// Contains a default DataViewSettingCollection for each DataTable in a DataSet.
 	/// </summary>
 	public class DataViewManager : MarshalByValueComponent
-	// IBindingList, ICollection, IList, ITypedList, IEnumerable
+		//, IBindingList, ICollection, IList, ITypedList, IEnumerable
 	{
 		private DataSet dataSet;