2 // System.Data.InternalDataCollectionBase.cs
6 // DataColumnCollection
8 // DataRelationCollection
9 // DataConstraintCollection
12 // Daniel Morgan <danmorg@sc.rr.com>
13 // Tim Coleman <tim@timcoleman.com>
15 // (C) Copyright 2002 Daniel Morgan
16 // (C) Copyright 2002 Tim Coleman
20 using System.Collections;
21 using System.ComponentModel;
26 /// Base class for System.Data collection classes
27 /// that are used within a DataTable object
28 /// to represent a collection of
29 /// relations, tables, rows, columns, and constraints
32 public class InternalDataCollectionBase : ICollection, IEnumerable
36 protected ArrayList list = null;
37 protected bool readOnly = false;
38 protected bool synchronized = false;
45 public InternalDataCollectionBase()
47 list = new ArrayList();
55 /// Gets the total number of elements in a collection.
57 public virtual int Count {
58 get { return list.Count; }
62 /// Gets a value indicating whether the InternalDataCollectionBase is read-only.
64 public bool IsReadOnly {
65 get { return readOnly; }
69 /// Gets a value indicating whether the InternalDataCollectionBase is synchronized.
71 public bool IsSynchronized {
72 get { return synchronized; }
76 /// Gets the items of the collection as a list.
78 protected internal virtual ArrayList List {
83 /// Gets an object that can be used to synchronize the collection.
85 public object SyncRoot {
88 // FIXME: how do we sync?
89 throw new NotImplementedException ();
99 /// Copies all the elements in the current InternalDataCollectionBase to a one-
100 /// dimensional Array, starting at the specified InternalDataCollectionBase index.
102 public void CopyTo(Array ar, int index)
104 list.CopyTo (ar, index);
109 /// Gets an IEnumerator for the collection.
111 public IEnumerator GetEnumerator()
113 return list.GetEnumerator ();