mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 01:41:17 -10:00
* System.Web/HttpResponse.cs: * System.Web.SessionState/HttpSessionState.cs: * System.Web.UI/LiteralControl.cs: * System.Web.UI.HtmlControls/HtmlAnchor.cs: * System.Web.UI.HtmlControls/HtmlButton.cs: * System.Web.UI.HtmlControls/HtmlControl.cs: * System.Web.UI.HtmlControls/HtmlForm.cs: * System.Web.UI.HtmlControls/HtmlGenericControl.cs: * System.Web.UI.HtmlControls/HtmlInputButton.cs: * System.Web.UI.HtmlControls/HtmlInputCheckBox.cs: * System.Web.UI.HtmlControls/HtmlInputControl.cs: * System.Web.UI.HtmlControls/HtmlInputFile.cs: * System.Web.UI.HtmlControls/HtmlInputHidden.cs: * System.Web.UI.HtmlControls/HtmlInputImage.cs: * System.Web.UI.HtmlControls/HtmlInputRadioButton.cs: * System.Web.UI.HtmlControls/HtmlInputText.cs: * System.Web.UI.HtmlControls/HtmlSelect.cs: * System.Web.UI.HtmlControls/HtmlTable.cs: * System.Web.UI.HtmlControls/HtmlTableCell.cs: * System.Web.UI.HtmlControls/HtmlTableRow.cs: * System.Web.UI.HtmlControls/HtmlTextArea.cs: Fixes based on class status page: - Add attributes (DefaultEvent, ParseChildren). - Fix declarations. - Explicitly implement some interfaces (IPostBackDataHandler and IPostBackEventHandler). - Implemented some missing methods. svn path=/trunk/mcs/; revision=5506
128 lines
3.1 KiB
C#
Executable File
128 lines
3.1 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;
|
|
using System.Collections.Specialized;
|
|
|
|
namespace System.Web.UI.HtmlControls{
|
|
|
|
public class HtmlInputImage : HtmlInputControl, IPostBackEventHandler, IPostBackDataHandler{
|
|
|
|
private static readonly object EventServerClick;
|
|
private int _x, _y;
|
|
|
|
public HtmlInputImage(): base("image"){}
|
|
|
|
protected override void OnPreRender(EventArgs e){
|
|
if (Page != null && !Disabled){
|
|
Page.RegisterRequiresPostBack(this);
|
|
}
|
|
}
|
|
|
|
protected override void RenderAttributes(HtmlTextWriter writer)
|
|
{
|
|
base.RenderAttributes (writer);
|
|
// Anything else?
|
|
}
|
|
|
|
protected virtual void OnServerClick(ImageClickEventArgs e){
|
|
ImageClickEventHandler handler = (ImageClickEventHandler) Events[EventServerClick];
|
|
if (handler != null) handler (this, e);
|
|
}
|
|
|
|
bool IPostBackDataHandler.LoadPostData (string postDataKey,
|
|
NameValueCollection postCollection)
|
|
{
|
|
string postX = postCollection[String.Concat(RenderedName,".x")];
|
|
string postY = postCollection[String.Concat(RenderedName,".y")];
|
|
if (postX != null && postY != null && postX.Length >= 0 && postY.Length >= 0){
|
|
_x = Int32.Parse(postX, CultureInfo.InvariantCulture);
|
|
_y = Int32.Parse(postY, CultureInfo.InvariantCulture);
|
|
Page.RegisterRequiresRaiseEvent(this);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
void IPostBackEventHandler.RaisePostBackEvent (string eventArgument)
|
|
{
|
|
if (CausesValidation)
|
|
Page.Validate();
|
|
OnServerClick (new ImageClickEventArgs(_x, _y));
|
|
}
|
|
|
|
void IPostBackDataHandler.RaisePostDataChangedEvent ()
|
|
{
|
|
}
|
|
|
|
public event EventHandler ServerClick{
|
|
add{
|
|
Events.AddHandler(EventServerClick, value);
|
|
}
|
|
remove{
|
|
Events.RemoveHandler(EventServerClick, value);
|
|
}
|
|
}
|
|
|
|
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 bool CausesValidation{
|
|
get{
|
|
object causesVal = ViewState["CausesValidation"];
|
|
if (causesVal != null) return (Boolean) causesVal;
|
|
return true;
|
|
}
|
|
set{
|
|
ViewState["CausesValidation"] = (Boolean) value;
|
|
}
|
|
}
|
|
|
|
public string Src{
|
|
get{
|
|
string attr = Attributes["src"];
|
|
if (attr != null) return attr;
|
|
return String.Empty;
|
|
}
|
|
set{
|
|
Attributes["src"] = AttributeToString(value);
|
|
}
|
|
}
|
|
} // class HtmlInputImage
|
|
} // namespace System.Web.UI.HtmlControls
|
|
|