2 // System.Web.UI.DataBindingCollection.cs
4 // Duncan Mak (duncan@ximian.com)
10 using System.Collections;
12 namespace System.Web.UI {
14 public sealed class DataBindingCollection : ICollection, IEnumerable
19 public DataBindingCollection ()
21 list = new Hashtable ();
22 removed = new ArrayList ();
26 get { return list.Count; }
29 public bool IsReadOnly {
30 get { return list.IsReadOnly; }
33 public bool IsSynchronized {
34 get { return list.IsSynchronized; }
37 public DataBinding this [string propertyName] {
38 get { return list [propertyName] as DataBinding; }
41 public string [] RemovedBindings {
42 get { return (string []) removed.ToArray (typeof (string)); }
45 public object SyncRoot {
46 get { return list.SyncRoot; }
49 public void Add (DataBinding binding)
51 list.Add (binding.PropertyName, binding);
59 public void CopyTo (Array array, int index)
61 list.CopyTo (array, index);
64 public IEnumerator GetEnumerator ()
66 return list.GetEnumerator ();
69 public void Remove (DataBinding binding)
71 string key = binding.PropertyName;
75 public void Remove (string propertyName)
77 removed.Add (propertyName);
78 list.Remove (propertyName);
81 public void Remove (string propertyName,
82 bool addToRemovedList)
85 removed.Add (String.Empty); // LAMESPEC
87 removed.Add (propertyName);
89 list.Remove (propertyName);