2 // System.Web.UI.DataSourceControl
5 // Ben Maurer (bmaurer@users.sourceforge.net)
11 using System.Collections;
12 using System.Collections.Specialized;
15 namespace System.Web.UI {
16 public abstract class DataSourceControl : Control, IDataSource, System.ComponentModel.IListSource {
19 protected DataSourceControl()
23 protected override ControlCollection CreateControlCollection ()
25 return new EmptyControlCollection (this);
28 protected virtual DataSourceView GetView (string viewName)
33 DataSourceView IDataSource.GetView (string viewName)
35 return GetView (viewName);
38 protected virtual ICollection GetViewNames ()
43 ICollection IDataSource.GetViewNames ()
45 return GetViewNames ();
48 IList System.ComponentModel.IListSource.GetList ()
50 return ListSourceHelper.GetList (this);
53 bool System.ComponentModel.IListSource.ContainsListCollection {
54 get { return ListSourceHelper.ContainsListCollection (this); }
57 //public override bool EnablePersonalization { get; set; }
58 //public override bool EnableTheming { get; set; }
59 //public override string SkinID { get; set; }
60 public override bool Visible {
62 set { throw new NotSupportedException (); }
65 static object dataSourceChanged = new object ();
66 event EventHandler System.Web.UI.IDataSource.DataSourceChanged {
67 add { Events.AddHandler (dataSourceChanged, value); }
68 remove { Events.RemoveHandler (dataSourceChanged, value); }
71 protected virtual void OnDataSourceChanged (EventArgs e)
73 EventHandler eh = Events [dataSourceChanged] as EventHandler;