2 // System.Data.DataRowView.cs
5 // Rodrigo Moya <rodrigo@ximian.com>
6 // Miguel de Icaza <miguel@ximian.com>
7 // Daniel Morgan <danmorg@sc.rr.com>
9 // (C) Ximian, Inc 2002
10 // (C) Daniel Morgan 2002
14 using System.Collections;
15 using System.ComponentModel;
16 using System.Reflection;
21 /// Represents a customized view of a DataRow exposed as a fully featured Windows Forms control.
23 public class DataRowView : ICustomTypeDescriptor, IEditableObject, IDataErrorInfo
29 DataRowVersion rowVersion = DataRowVersion.Default;
31 // FIXME: what are the defaults?
39 internal DataRowView (DataView dataView, DataRow row) {
40 this.dataView = dataView;
44 #endregion // Constructors
49 public void BeginEdit ()
55 public void CancelEdit ()
61 public DataView CreateChildView (DataRelation relation)
63 throw new NotImplementedException ();
67 public DataView CreateChildView (string name)
69 throw new NotImplementedException ();
75 throw new NotImplementedException ();
79 public void EndEdit ()
88 public DataView DataView
110 [System.Runtime.CompilerServices.IndexerName("Item")]
111 public object this[string column] {
114 DataColumn dc = dataView.Table.Columns[column];
119 DataColumn dc = dataView.Table.Columns[column];
124 public string Error {
130 // the compiler creates a DefaultMemeberAttribute from
131 // this IndexerNameAttribute
132 public object this[int column] {
135 DataColumn dc = dataView.Table.Columns[column];
140 DataColumn dc = dataView.Table.Columns[column];
153 public DataRowVersion RowVersion {
160 #endregion // Properties
162 #region ICustomTypeDescriptor implementations
165 AttributeCollection ICustomTypeDescriptor.GetAttributes ()
167 System.ComponentModel.AttributeCollection attributes;
\r
168 attributes = AttributeCollection.Empty;
\r
173 string ICustomTypeDescriptor.GetClassName ()
179 string ICustomTypeDescriptor.GetComponentName ()
185 TypeConverter ICustomTypeDescriptor.GetConverter ()
191 EventDescriptor ICustomTypeDescriptor.GetDefaultEvent ()
197 PropertyDescriptor ICustomTypeDescriptor.GetDefaultProperty ()
203 object ICustomTypeDescriptor.GetEditor (Type editorBaseType)
209 EventDescriptorCollection ICustomTypeDescriptor.GetEvents ()
211 return new EventDescriptorCollection(null);
215 EventDescriptorCollection ICustomTypeDescriptor.GetEvents (Attribute [] attributes)
217 return new EventDescriptorCollection(null);
221 PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties ()
223 ITypedList typedList = (ITypedList) dataView;
224 return typedList.GetItemProperties(new PropertyDescriptor[0]);
228 PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties (Attribute [] attributes)
230 PropertyDescriptorCollection descriptors;
231 descriptors = ((ICustomTypeDescriptor) this).GetProperties ();
232 // TODO: filter out descriptors which do not contain
233 // any of those attributes
234 // except, those descriptors
235 // that contain DefaultMemeberAttribute
240 object ICustomTypeDescriptor.GetPropertyOwner (PropertyDescriptor pd)
245 #endregion // ICustomTypeDescriptor implementations
247 #region IDataErrorInfo implementation
249 string IDataErrorInfo.Error {
256 string IDataErrorInfo.this[string columnName] {
263 #endregion // IDataErrorInfo implementation