Files
mono/mcs/class/System.Web/System.Web.UI/AttributeCollection.cs
T
Gonzalo Paniagua Javier 62aeab6dc1 2002-06-05 Gonzalo Paniagua Javier <[email protected]>
* System.Web.UI/AttributeCollection.cs: don't need a Hastable. StateBag
	now works fine and takes care of the details.

	* System.Web.UI/Control.cs: added HasChildren property.

	* System.Web.UI/StateBag.cs: fixed a couple of nasty bugs.

	* System.Web.UI.HtmlControls/HtmlButton.cs: RenderAttributes is an
	override, not new.

	* System.Web.UI.HtmlControls/HtmlContainerControl.cs: use the new
	Render method in HtmlControl.

	* System.Web.UI.HtmlControls/HtmlControl.cs: added Render method to
	render the tag and its attributes. Works for container and
	non-containers.

	* System.Web.UI.HtmlControls/HtmlImage.cs: RenderAttributes don't need
	to be new. Implemented Height property.

svn path=/trunk/mcs/; revision=5130
2002-06-05 15:58:32 +00:00

74 lines
1.2 KiB
C#
Executable File

//
// System.Web.UI.AttributeCollection.cs
//
// Duncan Mak ([email protected])
//
// (C) Ximian, Inc.
//
using System;
using System.Collections;
namespace System.Web.UI {
public sealed class AttributeCollection
{
private StateBag bag;
public AttributeCollection (StateBag bag)
{
this.bag = bag;
}
public int Count {
get { return bag.Count; }
}
[MonoTODO]
public CssStyleCollection CssStyle {
get { return null; }
}
public string this [string key] {
get { return bag [key] as string; }
set { bag.Add (key, value); }
}
public ICollection Keys {
get { return bag.Keys; }
}
public void Add (string key, string value)
{
bag.Add (key, value); // if exists, only the value is replaced.
}
public void AddAttributes (HtmlTextWriter writer)
{
foreach (string key in bag.Keys) {
string value = bag [key] as string;
writer.AddAttribute (key, value);
}
}
public void Clear ()
{
bag.Clear ();
}
public void Remove (string key)
{
bag.Remove (key);
}
public void Render (HtmlTextWriter writer)
{
foreach (string key in bag.Keys) {
string value = bag [key] as string;
writer.WriteAttribute (key, value);
}
}
}
}