2 * Namespace: System.Web.UI.WebControls
6 * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
9 * (C) Gaurav Vaish (2001)
16 using System.Collections.Specialized;
18 namespace System.Web.UI.WebControls
20 public class WebControl : Control, IAttributeAccessor
22 //TODO: A list of private members may be incomplete
24 private static int i = 0;
25 private string _accessKey = string.Empty;
26 private string _clientID;
27 private Color _backColor = Color.Empty;
28 private Color _borderColor = Color.Empty;
29 private BorderStyle _bStyle;
30 private Unit _borderWidth = Unit.Empty;
31 private Style _controlStyle = null; //TODO: What's initial value?
32 private string _cssClass = string.Empty;
33 private bool _enabled = true;
34 private FontInfo _font;
36 // TODO: Should this have other methods called? or
37 // the values should be left blank - to be used up by the end-user?
38 private AttributeCollection _attributes = new AttributeCollection( new System.Web.UI.StateBag());
40 public virtual string AccessKey
52 public virtual AttributeCollection Attributes
60 public virtual Color BackColor
72 public virtual Color BorderColor
84 // TODO: Confused with the enum BorderStyle and variable BorderStyle
85 //public virtual BorderStyle BorderStyle { get; set; }
87 public virtual Unit BorderWidth
99 public override string ClientID
103 _clientID = "WebControl" + i++;
108 public Style ControlStyle
112 return _controlStyle;
116 // TODO: The exact purpose of the field is not known
117 // public bool ControlStyleCreated { get; }
119 public virtual string CssClass
131 public virtual bool Enabled
143 public virtual FontInfo Font
151 // TODO: The constructors definitions
152 protected WebControl()
156 public WebControl(HtmlTextWriterTag tag)
160 protected WebControl(string tag)
164 // Implemented procedures
166 public string GetAttribute(string key)
171 public void SetAttribute(string key, string val)
178 public ControlCollection Controls { virtual get; }
179 public Style ControlStyle { get; }
180 public bool ControlStyleCreated { get; }
181 public bool EnableViewState { virtual get; virtual set; }
182 public FontInfo Font { virtual get; }
183 public Color ForeColor { virtual get; virtual set; }
184 public Unit Height { virtual get; virtual set; }
185 public string ID { virtual get; virtual set; }
186 public Control NamingContainer { virtual get; }
187 public Page Page { virtual get; virtual set; }
188 public Control Parent { virtual get; }
189 public ISite Site { virtual get; virtual set; }
190 public CssStyleCollection Style { get; }
191 public short TabIndex { virtual get; virtual set; }
192 public string TemplateSourceDirectory { virtual get; }
193 public string ToolTip { virtual get; virtual set; }
194 public string UniqueID { virtual get; }
195 public bool Visible { virtual get; virtual set; }
196 public Unit Width { virtual get; virtual set; }
199 public event EventHandler DataBinding;
200 public event EventHandler Disposed;
201 public event EventHandler Init;
202 public event EventHandler Load;
203 public event EventHandler PreRender;
204 public event EventHandler Unload;
207 public void ApplyStyle(System.Web.UI.WebControls.Style s);
208 public void CopyBaseAttributes(System.Web.UI.WebControls.WebControl controlSrc);
209 public virtual void DataBind();
210 public virtual void Dispose();
211 public virtual bool Equals(object obj);
212 public virtual System.Web.UI.Control FindControl(string id);
213 public virtual int GetHashCode();
214 public Type GetType();
215 public virtual bool HasControls();
216 public void MergeStyle(System.Web.UI.WebControls.Style s);
217 public virtual void RenderBeginTag(System.Web.UI.HtmlTextWriter writer);
218 public void RenderControl(System.Web.UI.HtmlTextWriter writer);
219 public virtual void RenderEndTag(System.Web.UI.HtmlTextWriter writer);
220 public string ResolveUrl(string relativeUrl);
221 public void SetRenderMethodDelegate(System.Web.UI.RenderMethod renderMethod);
222 public virtual string ToString();