Files
mono/mcs/class/System.Windows.Forms/Gtk/BindingsCollection.cs
T
Joel Basson 636605aaa2 Tue Nov 18 23:00:00 GMT+2 2003 Joel Basson <[email protected]>
* New start to DataGrid. Imported files from swf-winelib
	* CurrencyManager.cs
	* BindingManagerBase.cs
	* BindingsCollection.cs
	* BaseCollection.cs
	* Binding.cs
	* ItemChangedEventArgs.cs
	* ItemChangedEventHandler.cs
	* ConvertEventArgs.cs
	* ConvertEventHandler.cs
	* BindingMemberInfo.cs
	* BorderStyle.cs
	* KeyEventArgs.cs
	* KeyEventHandler.cs
	* KeyPressEventArgs.cs
	* KeyPressEventHandler.cs
	* Keys.cs
	* AccessibleObject.cs
	* AccessibleEvents.cs
	* AccessibleNavigation.cs
	* AccessibleRole.cs
	* AccessibleSelection.cs
	* AccessibleStates.cs
	* NavigateEventArgs.cs
	* NavigateEventHandler.cs
	* PaintEventArgs.cs
	* PaintEventHandler.cs
	* GridTableStylesCollection.cs
	* GridColumnStylesCollection.cs
	* DataGrid.cs
	* IDataGridColumnStyleEditingNotificationService.cs
	* IDataGridEditingService.cs
	* DataGridColumnStyle.cs
	* DataGridBoolColumn.cs
	* DataGridCell.cs
	* DataGridLineStyle.cs
	* DataGridParentRowsLabelStyle.cs
	* DataGridPreferredColumnWidthTypeConverter.cs
	* DataGridTableStyle.cs
	* DataGridTextBoxColumn.cs
	* DataGridTextBox.cs

svn path=/trunk/mcs/; revision=20189
2003-11-18 21:14:15 +00:00

121 lines
2.5 KiB
C#

//
// System.Windows.Forms.BindingsCollection.cs
//
// Author:
// stubbed out by Jaak Simm ([email protected])
// Dennis Hayes ([email protected])
//
// (C) 2002/3 Ximian, Inc
//
using System.Collections;
using System.ComponentModel;
namespace System.Windows.Forms {
/// <summary>
/// Represents a collection of Binding objects for a control.
///
/// </summary>
public class BindingsCollection : BaseCollection {
#region Constructors
protected internal BindingsCollection ()
{
}
#endregion
// --- public and protected Properties ---
public override int Count {
get {
return base.Count;
}
}
public Binding this[int index] {
get {
return (Binding)(base.List[index]);
}
}
[MonoTODO]
protected override ArrayList List {
get {
return base.List;
}
}
// --- public Methods ---
// following internal methods are (will) not be stubbed out:
[MonoTODO]
protected virtual void AddCore(Binding dataBinding) {
}
[MonoTODO]
protected virtual void ClearCore(){
}
[MonoTODO]
protected virtual void RemoveCore(Binding dataBinding){
}
//
// CollectionChanged event:
// Though it was not documented, here methods Add and Remove
// cause the CollectionChanged event to occur, similarily as Clear.
// Would be nice if someone checked the exact event behavior of .NET implementation.
protected internal void Add(Binding binding)
{
base.List.Add(binding);
OnCollectionChanged(new CollectionChangeEventArgs(
CollectionChangeAction.Add,
base.List
));
}
protected internal void Clear()
{
base.List.Clear();
OnCollectionChanged(new CollectionChangeEventArgs(
CollectionChangeAction.Refresh,
base.List
));
}
protected virtual void OnCollectionChanged(CollectionChangeEventArgs ccevent)
{
if (CollectionChanged != null)
CollectionChanged(this, ccevent);
}
protected internal void Remove(Binding binding)
{
base.List.Remove(binding);
OnCollectionChanged(new CollectionChangeEventArgs(
CollectionChangeAction.Remove,
base.List
));
}
protected internal void RemoveAt(int index)
{
base.List.RemoveAt(index);
OnCollectionChanged(new CollectionChangeEventArgs(
CollectionChangeAction.Remove,
base.List
));
}
protected internal bool ShouldSerializeMyAll()
{
if (this.Count>0) return true;
else return false;
}
// public events
public event CollectionChangeEventHandler CollectionChanged;
}
}