2 // System.Windows.Forms.BindingsCollection.cs
5 // stubbed out by Jaak Simm (jaaksimm@firm.ee)
6 // Dennis Hayes (dennish@Raytek.com)
8 // (C) 2002 Ximian, Inc
11 using System
.Collections
;
12 using System
.ComponentModel
;
14 namespace System
.Windows
.Forms
{
17 /// Represents a collection of Binding objects for a control.
22 public class BindingsCollection
: BaseCollection
{
25 protected internal BindingsCollection ()
30 // --- public and protected Properties ---
31 public virtual int Count
{
37 public Binding
this[int index
] {
39 return (Binding
)(base.List
[index
]);
44 protected override ArrayList List
{
50 // --- public Methods ---
51 // following internal methods are (will) not be stubbed out:
52 // - protected virtual void AddCore(Binding dataBinding);
53 // - protected virtual void ClearCore();
54 // - protected virtual void RemoveCore(Binding dataBinding);
56 // CollectionChanged event:
57 // Though it was not documented, here methods Add and Remove
58 // cause the CollectionChanged event to occur, similarily as Clear.
59 // Would be nice if someone checked the exact event behavior of .NET implementation.
61 protected internal void Add(Binding binding
)
63 base.List
.Add(binding
);
64 OnCollectionChanged(new CollectionChangeEventArgs(
65 CollectionChangeAction
.Add
,
70 protected internal void Clear()
73 OnCollectionChanged(new CollectionChangeEventArgs(
74 CollectionChangeAction
.Refresh
,
79 protected virtual void OnCollectionChanged(CollectionChangeEventArgs ccevent
)
81 if (CollectionChanged
!= null)
82 CollectionChanged(this, ccevent
);
85 protected internal void Remove(Binding binding
)
87 base.List
.Remove(binding
);
88 OnCollectionChanged(new CollectionChangeEventArgs(
89 CollectionChangeAction
.Remove
,
94 protected internal void RemoveAt(int index
)
96 base.List
.RemoveAt(index
);
97 OnCollectionChanged(new CollectionChangeEventArgs(
98 CollectionChangeAction
.Remove
,
103 protected internal bool ShouldSerializeMyAll()
105 throw new NotImplementedException ();
106 if (this.Count
>0) return true;
111 public event CollectionChangeEventHandler CollectionChanged
;