2 // System.Data.DataViewManager
5 // Rodrigo Moya (rodrigo@ximian.com)
6 // Tim Coleman (tim@timcoleman.com)
8 // (C) Ximian, Inc. 2002
9 // Copyright (C) Tim Coleman, 2002
13 using System.Collections;
14 using System.ComponentModel;
19 /// Contains a default DataViewSettingCollection for each DataTable in a DataSet.
22 public class DataViewManager : MarshalByValueComponent, IBindingList, ICollection, IList, ITypedList, IEnumerable
27 DataViewManagerListItemTypeDescriptor descriptor;
33 public DataViewManager ()
38 public DataViewManager (DataSet ds)
43 #endregion // Constructors
47 [DataSysDescription ("Indicates the source of data for this DataViewManager.")]
49 public DataSet DataSet {
50 get { return dataSet; }
51 set { dataSet = value; }
55 [DataSysDescription ("Indicates the sorting/filtering/state settings for any table in the corresponding DataSet.")]
56 [DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
57 public string DataViewSettingCollectionString {
58 get { throw new NotImplementedException (); }
59 set { throw new NotImplementedException (); }
63 public DataViewSettingCollection DataViewSettings {
64 get { throw new NotImplementedException (); }
67 int ICollection.Count {
69 get { throw new NotImplementedException (); }
72 bool ICollection.IsSynchronized {
74 get { throw new NotImplementedException (); }
77 object ICollection.SyncRoot {
79 get { throw new NotImplementedException (); }
82 bool IList.IsFixedSize {
86 bool IList.IsReadOnly {
90 object IList.this [int index] {
92 if (descriptor == null)
93 descriptor = new DataViewManagerListItemTypeDescriptor (this);
98 set { throw new ArgumentException ("Not modifiable"); }
101 bool IBindingList.AllowEdit {
103 get { throw new NotImplementedException (); }
106 bool IBindingList.AllowNew {
108 get { throw new NotImplementedException (); }
111 bool IBindingList.AllowRemove {
113 get { throw new NotImplementedException (); }
116 bool IBindingList.IsSorted {
118 get { throw new NotImplementedException (); }
121 ListSortDirection IBindingList.SortDirection {
123 get { throw new NotImplementedException (); }
126 PropertyDescriptor IBindingList.SortProperty {
128 get { throw new NotImplementedException (); }
131 bool IBindingList.SupportsChangeNotification {
133 get { throw new NotImplementedException (); }
136 bool IBindingList.SupportsSearching {
138 get { throw new NotImplementedException (); }
141 bool IBindingList.SupportsSorting {
143 get { throw new NotImplementedException (); }
146 #endregion // Properties
151 public DataView CreateDataView (DataTable table)
153 return new DataView (table);
157 void IBindingList.AddIndex (PropertyDescriptor property)
159 throw new NotImplementedException ();
163 object IBindingList.AddNew ()
165 throw new NotImplementedException ();
169 void IBindingList.ApplySort (PropertyDescriptor property, ListSortDirection direction)
171 throw new NotImplementedException ();
175 int IBindingList.Find (PropertyDescriptor property, object key)
177 throw new NotImplementedException ();
181 void IBindingList.RemoveIndex (PropertyDescriptor property)
183 throw new NotImplementedException ();
187 void IBindingList.RemoveSort ()
189 throw new NotImplementedException ();
193 void ICollection.CopyTo (Array array, int index)
195 throw new NotImplementedException ();
199 IEnumerator IEnumerable.GetEnumerator ()
201 throw new NotImplementedException ();
205 int IList.Add (object value)
207 throw new NotImplementedException ();
213 throw new NotImplementedException ();
217 bool IList.Contains (object value)
219 throw new NotImplementedException ();
223 int IList.IndexOf (object value)
225 throw new NotImplementedException ();
229 void IList.Insert (int index, object value)
231 throw new NotImplementedException ();
235 void IList.Remove (object value)
237 throw new NotImplementedException ();
241 void IList.RemoveAt (int index)
243 throw new NotImplementedException ();
246 PropertyDescriptorCollection ITypedList.GetItemProperties (PropertyDescriptor[] listAccessors)
249 throw new DataException ("dataset is null");
251 if (listAccessors == null || listAccessors.Length == 0) {
252 ICustomTypeDescriptor desc = new DataViewManagerListItemTypeDescriptor (this);
253 return desc.GetProperties ();
256 throw new NotImplementedException ();
260 string ITypedList.GetListName (PropertyDescriptor[] listAccessors)
262 throw new NotImplementedException ();
265 protected virtual void OnListChanged (ListChangedEventArgs e)
267 if (ListChanged != null)
268 ListChanged (this, e);
271 protected virtual void RelationCollectionChanged (object sender, CollectionChangeEventArgs e)
275 protected virtual void TableCollectionChanged (object sender, CollectionChangeEventArgs e)
279 #endregion // Methods
283 public event ListChangedEventHandler ListChanged;