2 * Namespace: System.Web.UI.WebControls
\r
5 * Author: Gaurav Vaish
\r
6 * Maintainer: gvaish@iitk.ac.in
\r
7 * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
\r
10 * (C) Gaurav Vaish (2001)
\r
14 using System.Collections;
\r
15 using System.Collections.Specialized;
\r
17 using System.Web.UI;
\r
19 namespace System.Web.UI.WebControls
\r
21 public class CheckBox : WebControl, IPostBackDataHandler
\r
23 private static readonly object CheckedChangedEvent = new object();
\r
30 public virtual bool AutoPostBack
\r
34 object o = ViewState["AutoPostBack"];
\r
36 return (bool)AutoPostBack;
\r
41 ViewState["AutoPostBack"] = value;
\r
45 public virtual bool Checked
\r
49 object o = ViewState["Checked"];
\r
56 ViewState["Checked"] = value;
\r
60 public virtual string Text
\r
64 object o = ViewState["Text"];
\r
67 return String.Empty;
\r
71 ViewState["Text"] = value;
\r
75 public virtual TextAlign TextAlign
\r
79 object o = ViewState["TextAlign"];
\r
81 return (TextAlign)o;
\r
82 return TextAlign.Right;
\r
86 if(!System.Enum.IsDefined(typeof(TextAlign), value))
\r
87 throw new ArgumentException();
\r
88 ViewState["TextAlign"] = value;
\r
92 public event EventHandler CheckedChanged
\r
96 Events.AddHandler(CheckedChangedEvent, value);
\r
100 Events.RemoveHandler(CheckedChangedEvent, value);
\r
104 protected virtual void OnCheckedChanged(EventArgs e)
\r
108 EventHandler eh = (EventHandler)(Events[CheckedChangedEvent]);
\r
114 protected override void Render(HtmlTextWriter writer)
\r
116 //TODO: THE LOST WORLD!
\r
117 // I know I have to do it.
\r
120 public bool LoadPostData(string postDataKey, NameValueCollection postCollection)
\r
122 //TODO: THE LOST WORLD
\r
123 // Now what the hell is this!
\r
127 public void RaisePostDataChangedEvent()
\r
129 //TODO: THE LOST WORLD...
\r
130 // Raise the bucket out of the well :))
\r
131 OnCheckedChanged(EventArgs.Empty);
\r