Files
mono/mcs/class/System.Web/System.Web.UI/DataBindingCollection.cs
T
Duncan Mak b3976280ad 2002-05-17 Duncan Mak <[email protected]>
* System.Web.build: Added new arguments: "/noconfig",
	"/r:System.Drawing.dll" and "/r:System.Xml.dll".

	* AttributeCollection.cs:
	* ControlCollection.cs:
	* CssStyleCollection.cs:
	* DataBindingCollection.cs:
	* EmptyControlCollection.cs: Added missing Collection classes.

	* BaseParser.cs:
	* TemplateParser.cs:  Implemented. BaseParser is weird because
	there is no documentation on what it does.

	* ControlBuilder.cs:

	* DataBinder.cs:
	* DataBinding.cs: Added.

	* DataBoundLiteralControl.cs:
	* Triplet.cs: Added.

	* RenderMethod.cs: Added this delegate for Control.cs

svn path=/trunk/mcs/; revision=4726
2002-05-17 20:54:14 +00:00

93 lines
1.6 KiB
C#
Executable File

//
// System.Web.UI.DataBindingCollection.cs
//
// Duncan Mak ([email protected])
//
// (C) Ximian, Inc.
//
using System;
using System.Collections;
namespace System.Web.UI {
public sealed class DataBindingCollection : ICollection, IEnumerable
{
Hashtable list;
ArrayList removed;
public DataBindingCollection ()
{
list = new Hashtable ();
removed = new ArrayList ();
}
public int Count {
get { return list.Count; }
}
public bool IsReadOnly {
get { return list.IsReadOnly; }
}
public bool IsSynchronized {
get { return list.IsSynchronized; }
}
public DataBinding this [string propertyName] {
get { return list [propertyName] as DataBinding; }
}
public string [] RemovedBindings {
get { return (string []) removed.ToArray (typeof (string)); }
}
public object SyncRoot {
get { return list.SyncRoot; }
}
public void Add (DataBinding binding)
{
list.Add (binding.PropertyName, binding);
}
public void Clear ()
{
list.Clear ();
}
public void CopyTo (Array array, int index)
{
list.CopyTo (array, index);
}
public IEnumerator GetEnumerator ()
{
return list.GetEnumerator ();
}
public void Remove (DataBinding binding)
{
string key = binding.PropertyName;
Remove (key);
}
public void Remove (string propertyName)
{
removed.Add (propertyName);
list.Remove (propertyName);
}
public void Remove (string propertyName,
bool addToRemovedList)
{
if (addToRemovedList)
removed.Add (String.Empty); // LAMESPEC
else
removed.Add (propertyName);
list.Remove (propertyName);
}
}
}