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 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
15 // Permission is hereby granted, free of charge, to any person obtaining
16 // a copy of this software and associated documentation files (the
17 // "Software"), to deal in the Software without restriction, including
18 // without limitation the rights to use, copy, modify, merge, publish,
19 // distribute, sublicense, and/or sell copies of the Software, and to
20 // permit persons to whom the Software is furnished to do so, subject to
21 // the following conditions:
23 // The above copyright notice and this permission notice shall be
24 // included in all copies or substantial portions of the Software.
26 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
27 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
28 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
29 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
30 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
31 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
32 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
36 using System
.Collections
;
37 using System
.ComponentModel
;
42 /// Contains a default DataViewSettingCollection for each DataTable in a DataSet.
45 [DesignerAttribute ("Microsoft.VSDesigner.Data.VS.DataViewManagerDesigner, "+ Consts
.AssemblyMicrosoft_VSDesigner
, "System.ComponentModel.Design.IDesigner")]
46 public class DataViewManager
: MarshalByValueComponent
, IBindingList
, ICollection
, IList
, ITypedList
, IEnumerable
51 DataViewManagerListItemTypeDescriptor descriptor
;
57 public DataViewManager ()
62 public DataViewManager (DataSet ds
)
67 #endregion // Constructors
71 [DataSysDescription ("Indicates the source of data for this DataViewManager.")]
73 public DataSet DataSet
{
74 get { return dataSet; }
75 set { dataSet = value; }
79 public string DataViewSettingCollectionString
{
80 get { throw new NotImplementedException (); }
81 set { throw new NotImplementedException (); }
85 [DataSysDescription ("Indicates the sorting/filtering/state settings for any table in the corresponding DataSet.")]
86 [DesignerSerializationVisibility (DesignerSerializationVisibility
.Content
)]
87 public DataViewSettingCollection DataViewSettings
{
88 get { throw new NotImplementedException (); }
91 int ICollection
.Count
{
93 get { throw new NotImplementedException (); }
96 bool ICollection
.IsSynchronized
{
98 get { throw new NotImplementedException (); }
101 object ICollection
.SyncRoot
{
103 get { throw new NotImplementedException (); }
106 bool IList
.IsFixedSize
{
110 bool IList
.IsReadOnly
{
114 object IList
.this [int index
] {
116 if (descriptor
== null)
117 descriptor
= new DataViewManagerListItemTypeDescriptor (this);
122 set { throw new ArgumentException ("Not modifiable"); }
125 bool IBindingList
.AllowEdit
{
127 get { throw new NotImplementedException (); }
130 bool IBindingList
.AllowNew
{
132 get { throw new NotImplementedException (); }
135 bool IBindingList
.AllowRemove
{
137 get { throw new NotImplementedException (); }
140 bool IBindingList
.IsSorted
{
142 get { throw new NotImplementedException (); }
145 ListSortDirection IBindingList
.SortDirection
{
147 get { throw new NotImplementedException (); }
150 PropertyDescriptor IBindingList
.SortProperty
{
152 get { throw new NotImplementedException (); }
155 bool IBindingList
.SupportsChangeNotification
{
157 get { throw new NotImplementedException (); }
160 bool IBindingList
.SupportsSearching
{
162 get { throw new NotImplementedException (); }
165 bool IBindingList
.SupportsSorting
{
167 get { throw new NotImplementedException (); }
170 #endregion // Properties
175 public DataView
CreateDataView (DataTable table
)
177 return new DataView (table
);
181 void IBindingList
.AddIndex (PropertyDescriptor property
)
183 throw new NotImplementedException ();
187 object IBindingList
.AddNew ()
189 throw new NotImplementedException ();
193 void IBindingList
.ApplySort (PropertyDescriptor property
, ListSortDirection direction
)
195 throw new NotImplementedException ();
199 int IBindingList
.Find (PropertyDescriptor property
, object key
)
201 throw new NotImplementedException ();
205 void IBindingList
.RemoveIndex (PropertyDescriptor property
)
207 throw new NotImplementedException ();
211 void IBindingList
.RemoveSort ()
213 throw new NotImplementedException ();
217 void ICollection
.CopyTo (Array array
, int index
)
219 throw new NotImplementedException ();
223 IEnumerator IEnumerable
.GetEnumerator ()
225 throw new NotImplementedException ();
229 int IList
.Add (object value)
231 throw new NotImplementedException ();
237 throw new NotImplementedException ();
241 bool IList
.Contains (object value)
243 throw new NotImplementedException ();
247 int IList
.IndexOf (object value)
249 throw new NotImplementedException ();
253 void IList
.Insert (int index
, object value)
255 throw new NotImplementedException ();
259 void IList
.Remove (object value)
261 throw new NotImplementedException ();
265 void IList
.RemoveAt (int index
)
267 throw new NotImplementedException ();
270 PropertyDescriptorCollection ITypedList
.GetItemProperties (PropertyDescriptor
[] listAccessors
)
273 throw new DataException ("dataset is null");
275 if (listAccessors
== null || listAccessors
.Length
== 0) {
276 ICustomTypeDescriptor desc
= new DataViewManagerListItemTypeDescriptor (this);
277 return desc
.GetProperties ();
280 throw new NotImplementedException ();
284 string ITypedList
.GetListName (PropertyDescriptor
[] listAccessors
)
286 throw new NotImplementedException ();
289 protected virtual void OnListChanged (ListChangedEventArgs e
)
291 if (ListChanged
!= null)
292 ListChanged (this, e
);
295 protected virtual void RelationCollectionChanged (object sender
, CollectionChangeEventArgs e
)
299 protected virtual void TableCollectionChanged (object sender
, CollectionChangeEventArgs e
)
303 #endregion // Methods
307 public event ListChangedEventHandler ListChanged
;