2 // System.Web.UI.DataSourceControl
5 // Ben Maurer (bmaurer@users.sourceforge.net)
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32 using System.Collections;
33 using System.Collections.Specialized;
34 using System.ComponentModel;
37 namespace System.Web.UI {
39 [DesignerAttribute ("System.Web.UI.Design.DataSourceDesigner, " + Consts.AssemblySystem_Design,
40 "System.ComponentModel.Design.IDesigner")]
41 [ControlBuilderAttribute (typeof (DataSourceControlBuilder))]
42 [NonVisualControlAttribute]
43 [BindableAttribute (false)]
44 public abstract class DataSourceControl : Control, IDataSource, System.ComponentModel.IListSource {
47 protected DataSourceControl()
52 [EditorBrowsable (EditorBrowsableState.Never)]
53 public override void ApplyStyleSheetSkin (Page page)
55 throw new NotImplementedException ();
58 protected override ControlCollection CreateControlCollection ()
60 return new EmptyControlCollection (this);
63 [MonoTODO ("why override?")]
64 [EditorBrowsable (EditorBrowsableState.Never)]
65 public override Control FindControl (string id)
67 return base.FindControl (id);
70 [MonoTODO ("why override?")]
71 [EditorBrowsable (EditorBrowsableState.Never)]
72 public override void Focus ()
77 protected abstract DataSourceView GetView (string viewName);
79 DataSourceView IDataSource.GetView (string viewName)
81 return GetView (viewName);
84 protected virtual ICollection GetViewNames ()
89 ICollection IDataSource.GetViewNames ()
91 return GetViewNames ();
94 IList System.ComponentModel.IListSource.GetList ()
96 return ListSourceHelper.GetList (this);
99 [MonoTODO ("why override?")]
100 [EditorBrowsable (EditorBrowsableState.Never)]
101 public override bool HasControls ()
103 return base.HasControls ();
106 protected virtual void RaiseDataSourceChangedEvent (EventArgs e)
108 EventHandler eh = Events [dataSourceChanged] as EventHandler;
113 [MonoTODO ("why override?")]
114 [EditorBrowsable (EditorBrowsableState.Never)]
115 public override void RenderControl (HtmlTextWriter tw)
117 base.RenderControl (tw);
120 [MonoTODO ("why override?")]
121 [EditorBrowsable (EditorBrowsableState.Never)]
122 public override string ClientID {
123 get { return base.ClientID; }
126 [MonoTODO ("why override?")]
127 [EditorBrowsable (EditorBrowsableState.Never)]
128 public override ControlCollection Controls {
129 get { return base.Controls; }
132 [MonoTODO ("why override?")]
133 [DefaultValue (false)]
135 [EditorBrowsable (EditorBrowsableState.Never)]
136 public override bool EnableTheming {
137 get { return base.EnableTheming; }
138 set { base.EnableTheming = value; }
141 [MonoTODO ("why override?")]
144 [EditorBrowsable (EditorBrowsableState.Never)]
145 public override string SkinID {
146 get { return base.SkinID; }
147 set { base.SkinID = value; }
150 bool System.ComponentModel.IListSource.ContainsListCollection {
151 get { return ListSourceHelper.ContainsListCollection (this); }
155 [EditorBrowsable (EditorBrowsableState.Never)]
156 [DefaultValue (false)]
157 public override bool Visible {
158 get { return false; }
159 set { throw new NotSupportedException (); }
162 static object dataSourceChanged = new object ();
163 event EventHandler System.Web.UI.IDataSource.DataSourceChanged {
164 add { Events.AddHandler (dataSourceChanged, value); }
165 remove { Events.RemoveHandler (dataSourceChanged, value); }