| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225 |
- /**
- * Namespace: System.Web.UI.WebControls
- * Class: WebControl
- *
- * Author: Gaurav Vaish
- * Contact: <[email protected]>, <[email protected]>
- * Status: Unknown %
- *
- * (C) Gaurav Vaish (2001)
- */
- using System;
- using System.Web;
- using System.Web.UI;
- using System.Drawing;
- using System.Collections.Specialized;
- namespace System.Web.UI.WebControls
- {
- public class WebControl : Control, IAttributeAccessor
- {
- //TODO: A list of private members may be incomplete
- private static int i = 0;
- private string _accessKey = string.Empty;
- private string _clientID;
- private Color _backColor = Color.Empty;
- private Color _borderColor = Color.Empty;
- private BorderStyle _bStyle;
- private Unit _borderWidth = Unit.Empty;
- private Style _controlStyle = null; //TODO: What's initial value?
- private string _cssClass = string.Empty;
- private bool _enabled = true;
- private FontInfo _font;
- // TODO: Should this have other methods called? or
- // the values should be left blank - to be used up by the end-user?
- private AttributeCollection _attributes = new AttributeCollection( new System.Web.UI.StateBag());
- public virtual string AccessKey
- {
- get
- {
- return _accessKey;
- }
- set
- {
- _accessKey = value;
- }
- }
- public virtual AttributeCollection Attributes
- {
- get
- {
- return _attributes;
- }
- }
- public virtual Color BackColor
- {
- get
- {
- return _backColor;
- }
- set
- {
- _backColor = value;
- }
- }
- public virtual Color BorderColor
- {
- get
- {
- return _borderColor;
- }
- set
- {
- _borderColor = value;
- }
- }
- // TODO: Confused with the enum BorderStyle and variable BorderStyle
- //public virtual BorderStyle BorderStyle { get; set; }
- public virtual Unit BorderWidth
- {
- get
- {
- return _borderWidth;
- }
- set
- {
- _borderWidth = value;
- }
- }
- public override string ClientID
- {
- get
- {
- _clientID = "WebControl" + i++;
- return _clientID;
- }
- }
- public Style ControlStyle
- {
- get
- {
- return _controlStyle;
- }
- }
-
- // TODO: The exact purpose of the field is not known
- // public bool ControlStyleCreated { get; }
- public virtual string CssClass
- {
- get
- {
- return _cssClass;
- }
- set
- {
- _cssClass = value;
- }
- }
- public virtual bool Enabled
- {
- get
- {
- return _enabled;
- }
- set
- {
- _enabled = value;
- }
- }
- public virtual FontInfo Font
- {
- get
- {
- return _font;
- }
- }
- // TODO: The constructors definitions
- protected WebControl()
- {
- }
- public WebControl(HtmlTextWriterTag tag)
- {
- }
- protected WebControl(string tag)
- {
- }
- // Implemented procedures
-
- public string GetAttribute(string key)
- {
- return "";
- }
-
- public void SetAttribute(string key, string val)
- {
-
- }
- /*
- // Properties
- public ControlCollection Controls { virtual get; }
- public Style ControlStyle { get; }
- public bool ControlStyleCreated { get; }
- public bool EnableViewState { virtual get; virtual set; }
- public FontInfo Font { virtual get; }
- public Color ForeColor { virtual get; virtual set; }
- public Unit Height { virtual get; virtual set; }
- public string ID { virtual get; virtual set; }
- public Control NamingContainer { virtual get; }
- public Page Page { virtual get; virtual set; }
- public Control Parent { virtual get; }
- public ISite Site { virtual get; virtual set; }
- public CssStyleCollection Style { get; }
- public short TabIndex { virtual get; virtual set; }
- public string TemplateSourceDirectory { virtual get; }
- public string ToolTip { virtual get; virtual set; }
- public string UniqueID { virtual get; }
- public bool Visible { virtual get; virtual set; }
- public Unit Width { virtual get; virtual set; }
- // Events
- public event EventHandler DataBinding;
- public event EventHandler Disposed;
- public event EventHandler Init;
- public event EventHandler Load;
- public event EventHandler PreRender;
- public event EventHandler Unload;
- // Methods
- public void ApplyStyle(System.Web.UI.WebControls.Style s);
- public void CopyBaseAttributes(System.Web.UI.WebControls.WebControl controlSrc);
- public virtual void DataBind();
- public virtual void Dispose();
- public virtual bool Equals(object obj);
- public virtual System.Web.UI.Control FindControl(string id);
- public virtual int GetHashCode();
- public Type GetType();
- public virtual bool HasControls();
- public void MergeStyle(System.Web.UI.WebControls.Style s);
- public virtual void RenderBeginTag(System.Web.UI.HtmlTextWriter writer);
- public void RenderControl(System.Web.UI.HtmlTextWriter writer);
- public virtual void RenderEndTag(System.Web.UI.HtmlTextWriter writer);
- public string ResolveUrl(string relativeUrl);
- public void SetRenderMethodDelegate(System.Web.UI.RenderMethod renderMethod);
- public virtual string ToString();
- //*/
- }
- }
|