-
+//
+// System.Web.UI.Design.WebControls.BaseDataListDesigner.cs
+//
+// Author: Duncan Mak (duncan@novell.com)
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-/**
- * Namespace: System.Web.UI.Design.WebControls
- * Class: BaseDataListDesigner
- *
- * Author: Gaurav Vaish
- * Maintainer: mastergaurav AT users DOT sf DOT net
- *
- * (C) Gaurav Vaish (2002)
- */
using System;
using System.Collections;
using System.ComponentModel;
using System.ComponentModel.Design;
-using System.Reflection;
-using System.Web.UI.Design;
-using System.Web.UI;
-using System.Web.UI.WebControls;
using System.Data;
+using System.Windows.Forms.Design;
+
+namespace System.Web.UI.Design.WebControls {
-namespace System.Web.UI.Design.WebControls
-{
- public abstract class BaseDataListDesigner : TemplatedControlDesigner,
- IDataSourceProvider
+ public abstract class BaseDataListDesigner : TemplatedControlDesigner, IDataSourceProvider
{
- private BaseDataList baseDataList;
- private DataTable desTimeDataTable;
- private DataTable dummyDataTable;
-
- private static readonly string[] validNames = new string[] {
- "AlternatingItemStyle",
- "BackColor",
- "DataSource",
- "DataMember",
- "EditItemStyle",
- "Font",
- "ForeColor",
- "HeaderStyle",
- "FooterStyle",
- "ItemStyle",
- "SelectedItemStyle",
- "SeparatorStyle"
- };
-
- public BaseDataListDesigner()
+ string data_key_field;
+ string data_member;
+ string data_source;
+
+ public BaseDataListDesigner ()
+ : base ()
{
}
- public string DataKeyField
- {
- get
- {
- return baseDataList.DataKeyField;
- }
- set
- {
- baseDataList.DataKeyField = value;
- }
+ public string DataKeyField {
+ get { return data_key_field; }
+ set { data_key_field = value; }
}
- public string DataMember
- {
- get
- {
- return baseDataList.DataMember;
- }
- set
- {
- baseDataList.DataMember = value;
- }
+ public string DataMember {
+ get { return data_member; }
+ set { data_member = value; }
+ }
+
+ public string DataSource {
+ get { return data_source; }
+ set { data_source = value; }
+ }
+
+ public override bool DesignTimeHtmlRequiresLoadComplete {
+ get { throw new NotImplementedException (); }
}
- public string DataSource
+ public override DesignerVerbCollection Verbs {
+ get { throw new NotImplementedException (); }
+ }
+
+ protected override void Dispose (bool disposing)
{
- get
- {
- DataBinding element = DataBindings["DataSource"];
- if(element != null)
- {
- return element.Expression;
- }
- return String.Empty;
- }
- set
- {
- if(value == null && value.Length == 0)
- {
- DataBindings.Remove("DataSource");
- } else
- {
- DataBinding element = DataBindings["DataSource"];
- if(element == null)
- {
- element = new DataBinding("DataSource",
- typeof(IEnumerable),
- value);
- } else
- {
- element.Expression = value;
- }
- DataBindings.Add(element);
- }
- OnDataSourceChanged();
- OnBindingsCollectionChanged("DataSource");
- }
- }
-
- protected internal virtual void OnDataSourceChanged()
+ throw new NotImplementedException ();
+ }
+
+ protected IEnumerable GetDesignTimeDataSource (
+ int minimum_rows,
+ out bool dummy_data_source)
{
- desTimeDataTable = null;
+ throw new NotImplementedException ();
}
- public override bool DesignTimeHtmlRequiresLoadComplete
+ protected IEnumerable GetDesignTimeDataSource (
+ IEnumerable selected_data_source,
+ int minimum_rows,
+ out bool dummy_data_source)
{
- get
- {
- return (DataSource.Length > 0);
- }
+ throw new NotImplementedException ();
}
- public override DesignerVerbCollection Verbs
+ public virtual IEnumerable GetResolvedSelectedDataSource ()
{
- get
- {
- throw new NotImplementedException();
- }
+ throw new NotImplementedException ();
}
- public object GetSelectedDataSource()
+ public virtual object GetSelectedDataSource ()
{
- object retVal = null;
- DataBinding element = DataBindings["DataSource"];
- if(element != null)
- {
- retVal = DesignTimeData.GetSelectedDataSource(baseDataList,
- element.Expression);
- }
- return retVal;
+ throw new NotImplementedException ();
}
- public IEnumerable GetResolvedSelectedDataSource()
+ public override IEnumerable GetTemplateContainerDataSource (string template_name)
{
- IEnumerable retVal = null;
- DataBinding element = DataBindings["DataSource"];
- if(element != null)
- {
- retVal = DesignTimeData.GetSelectedDataSource(baseDataList,
- element.Expression,
- DataMember);
- }
- return retVal;
- }
-
- public override IEnumerable GetTemplateContainerDataSource(
- string templateName)
+ throw new NotImplementedException ();
+ }
+
+ public override void Initialize (IComponent component)
{
- return GetResolvedSelectedDataSource();
+ throw new NotImplementedException ();
}
- public override void Initialize(IComponent component)
+ protected internal void InvokePropertyBuilder (int initial_page)
{
- baseDataList = (BaseDataList)component;
- base.Initialize(component);
+ throw new NotImplementedException ();
}
- public override void OnComponentChanged(object sender,
- ComponentChangedEventArgs e)
+ protected void OnAutoFormat (object sender, EventArgs e)
{
- if(e.Member != null)
- {
- string name = e.Member.Name;
- foreach(string current in validNames)
- {
- if(name == current)
- {
- OnStylesChanged();
- break;
- }
- }
- }
- base.OnComponentChanged(sender, e);
- }
-
- protected internal void OnStylesChanged()
+ throw new NotImplementedException ();
+ }
+
+ public override void OnComponentChanged (object sender, ComponentChangedEventArgs e)
{
- OnTemplateEditingVerbsChanged();
+ throw new NotImplementedException ();
}
- protected abstract void OnTemplateEditingVerbsChanged();
+ protected internal virtual void OnDataSourceChanged ()
+ {
+ throw new NotImplementedException ();
+ }
- protected override void Dispose(bool disposing)
+ protected void OnPropertyBuilder (object sender, EventArgs e)
{
- if(disposing)
- baseDataList = null;
- base.Dispose(disposing);
+ throw new NotImplementedException ();
}
- protected IEnumerable GetDesignTimeDataSource(int minimumRows,
- out bool dummyDataSource)
+ protected internal void OnStylesChanged ()
{
- return GetDesignTimeDataSource(GetResolvedSelectedDataSource(),
- minimumRows,
- out dummyDataSource);
+ throw new NotImplementedException ();
}
- protected IEnumerable GetDesignTimeDataSource(IEnumerable selectedDataSource,
- int minimumRows,
- out bool dummyDataSource)
+ protected abstract void OnTemplateEditingVerbsChanged ();
+
+ protected override void PreFilterProperties (IDictionary properties)
{
- DataTable toDeploy = desTimeDataTable;
- dummyDataSource = false;
- if(minimumRows == 0)
- {
- if(selectedDataSource != null)
- {
- desTimeDataTable = DesignTimeData.CreateSampleDataTable(
- selectedDataSource);
- toDeploy = desTimeDataTable;
- }
- if(toDeploy == null)
- {
- if(dummyDataTable == null)
- dummyDataTable = DesignTimeData.CreateDummyDataTable();
- toDeploy = dummyDataTable;
- dummyDataSource = true;
- }
- }
- return DesignTimeData.GetDesignTimeDataSource(toDeploy, minimumRows);
+ throw new NotImplementedException ();
}
}
-}
+}
\ No newline at end of file