mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 11:21:39 -10:00
* list: added some more files from System.Web.Hosting. * System.Web.UI/ConstructorNeedsTagAttribute.cs: the default constructor sets the property to false. * System.Web.UI.HtmlControls/HtmlGenericControl.cs: fixed TagName signature and get/set. * System.Web.UI.HtmlControls/HtmlInputImage.cs: added attribute and fixed signature of ServerClick. * System.Web.UI.HtmlControls/HtmlInputText.cs: added attribute. * System.Web.UI.WebControls/AdRotator.cs: * System.Web.UI.WebControls/Button.cs: * System.Web.UI.WebControls/Calendar.cs: * System.Web.UI.WebControls/CheckBox.cs: * System.Web.UI.WebControls/CheckBoxList.cs: * System.Web.UI.WebControls/DataList.cs: * System.Web.UI.WebControls/DropDownList.cs: * System.Web.UI.WebControls/HyperLink.cs: * System.Web.UI.WebControls/HyperLinkColumn.cs: * System.Web.UI.WebControls/Image.cs: * System.Web.UI.WebControls/ImageButton.cs: * System.Web.UI.WebControls/Label.cs: * System.Web.UI.WebControls/LinkButton.cs: * System.Web.UI.WebControls/ListBox.cs: * System.Web.UI.WebControls/Panel.cs: * System.Web.UI.WebControls/PlaceHolder.cs: * System.Web.UI.WebControls/RadioButton.cs: * System.Web.UI.WebControls/RadioButtonList.cs: * System.Web.UI.WebControls/Table.cs: * System.Web.UI.WebControls/TableRow.cs: * System.Web.UI.WebControls/TextBox.cs: * System.Web.UI.WebControls/WebControl.cs: removed attributes added by mistake (i used GetCustomAttributes (true), d'oh!). * System.Web.UI.WebControls/DataListItem.cs: implemented RenderItem. * System.Web.UI.WebControls/Repeater.cs: implemented CreateItem and InitializeItem. svn path=/trunk/mcs/; revision=5749
119 lines
2.1 KiB
C#
119 lines
2.1 KiB
C#
/**
|
|
* Namespace: System.Web.UI.WebControls
|
|
* Class: Image
|
|
*
|
|
* Author: Gaurav Vaish
|
|
* Maintainer: [email protected]
|
|
* Contact: <[email protected]>, <[email protected]>
|
|
* Implementation: yes
|
|
* Status: 100%
|
|
*
|
|
* (C) Gaurav Vaish (2001)
|
|
*/
|
|
|
|
using System;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.ComponentModel;
|
|
|
|
namespace System.Web.UI.WebControls
|
|
{
|
|
[DefaultProperty("ImageUrl")]
|
|
public class Image : WebControl
|
|
{
|
|
public Image(): base(HtmlTextWriterTag.Img)
|
|
{
|
|
}
|
|
|
|
public virtual string AlternateText
|
|
{
|
|
get
|
|
{
|
|
object o = ViewState["AlternateText"];
|
|
if(o!=null)
|
|
return (string)o;
|
|
return String.Empty;
|
|
}
|
|
set
|
|
{
|
|
ViewState["AlternateText"] = value;
|
|
}
|
|
}
|
|
|
|
public override bool Enabled
|
|
{
|
|
get
|
|
{
|
|
return base.Enabled;
|
|
}
|
|
set
|
|
{
|
|
base.Enabled = value;
|
|
}
|
|
}
|
|
|
|
public override FontInfo Font
|
|
{
|
|
get
|
|
{
|
|
return base.Font;
|
|
}
|
|
}
|
|
|
|
public virtual ImageAlign ImageAlign
|
|
{
|
|
get
|
|
{
|
|
object o = ViewState["ImageAlign"];
|
|
if(o!=null)
|
|
return (ImageAlign)o;
|
|
return ImageAlign.NotSet;
|
|
}
|
|
set
|
|
{
|
|
ViewState["ImageAlign"] = value;
|
|
}
|
|
}
|
|
|
|
public virtual string ImageUrl
|
|
{
|
|
get
|
|
{
|
|
object o = ViewState["ImageUrl"];
|
|
if(o!=null)
|
|
return (string)o;
|
|
return String.Empty;
|
|
}
|
|
set
|
|
{
|
|
ViewState["ImageUrl"] = value;
|
|
}
|
|
}
|
|
|
|
protected override void AddAttributesToRender(HtmlTextWriter writer)
|
|
{
|
|
base.AddAttributesToRender(writer);
|
|
if(ImageUrl.Length > 0)
|
|
{
|
|
writer.AddAttribute(HtmlTextWriterAttribute.Src, ResolveUrl(ImageUrl));
|
|
}
|
|
if(AlternateText.Length > 0)
|
|
{
|
|
writer.AddAttribute(HtmlTextWriterAttribute.Alt, AlternateText);
|
|
}
|
|
if(BorderWidth.IsEmpty)
|
|
{
|
|
writer.AddAttribute(HtmlTextWriterAttribute.Border, "0");
|
|
}
|
|
if(ImageAlign != ImageAlign.NotSet)
|
|
{
|
|
writer.AddAttribute(HtmlTextWriterAttribute.Align, Enum.Format(typeof(ImageAlign), ImageAlign, "G"));
|
|
}
|
|
}
|
|
|
|
protected override void RenderContents(HtmlTextWriter writer)
|
|
{
|
|
}
|
|
}
|
|
}
|