Files
mono/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlImage.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

104 lines
2.0 KiB
C#
Executable File

/* System.Web.UI.HtmlControls
* Authors
* Leen Toelen ([email protected])
*/
using System;
using System.Web;
using System.Web.UI;
using System.Globalization;
namespace System.Web.UI.HtmlControls{
public class HtmlImage : HtmlControl{
public HtmlImage(): base("img"){}
protected override void RenderAttributes(HtmlTextWriter writer){
PreProcessRelativeReference(writer,"src");
base.RenderAttributes(writer);
writer.Write(" /");
}
public string Align{
get{
string attr = Attributes["align"];
if (attr != null){
return attr;
}
return String.Empty;
}
set{
Attributes["align"] = AttributeToString(value);
}
}
public string Alt{
get{
string attr = Attributes["alt"];
if (attr != null){
return attr;
}
return String.Empty;
}
set{
Attributes["alt"] = AttributeToString(value);
}
}
public int Border{
get{
string attr = Attributes["border"];
if (attr != null){
return Int32.Parse(attr,CultureInfo.InvariantCulture);
}
return -1;
}
set{
Attributes["border"] = AttributeToString(value);
}
}
public int Height
{
get {
string attr = Attributes ["height"];
if (attr != null)
return Int32.Parse (attr, CultureInfo.InvariantCulture);
return -1;
}
set { Attributes["height"] = AttributeToString (value); }
}
public string Src{
get{
string attr = Attributes["src"];
if (attr != null){
return attr;
}
return String.Empty;
}
set{
Attributes["src"] = AttributeToString(value);
}
}
public int Width{
get{
string attr = Attributes["width"];
if (attr != null){
return Int32.Parse(attr,CultureInfo.InvariantCulture);
}
return -1;
}
set{
Attributes["width"] = AttributeToString(value);
}
}
} // class HtmlImage
} // namespace System.Web.UI.HtmlControls