Almost eliminate wrong use of Constants.WsaNamespace.
[mono.git] / mcs / class / System.Design / System.Web.UI.Design.WebControls / BaseDataListDesigner.cs
old mode 100755 (executable)
new mode 100644 (file)
index 71adcea..22f9b85
-/**
- * Namespace:   System.Web.UI.Design.WebControls
- * Class:       BaseDataListDesigner
- *
- * Author:      Gaurav Vaish
- * Maintainer:  mastergaurav AT users DOT sf DOT net
- *
- * (C) Gaurav Vaish (2002)
- */
+//
+// 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
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
 
 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
-{
-       public abstract class BaseDataListDesigner : TemplatedControlDesigner,
-                                                    IDataSourceProvider
+namespace System.Web.UI.Design.WebControls {
+
+       public abstract class BaseDataListDesigner : TemplatedControlDesigner, IDataSourceProvider
        {
-               private BaseDataList baseDataList;
-               private DataTable    desTimeDataTable;
-
-               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 override DesignerVerbCollection Verbs {
+                       get { throw new NotImplementedException (); }
                }
 
-               public string DataSource
+               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 ()
                {
-                       IEnumerable retVal = GetResolvedSelectedDataSource();
-                       return GetDesignTimeDataSource(retVal, minimumRows,
-                                                      out dummyDataSource);
+                       throw new NotImplementedException ();
                }
 
-               [MonoTODO]
-               protected IEnumerable GetDesignTimeDataSource(IEnumerable selectedDataSource,
-                                                             int minimumRows,
-                                                             out bool dummyDataSource)
+               protected abstract void OnTemplateEditingVerbsChanged ();
+
+               protected override void PreFilterProperties (IDictionary properties)
                {
-                       throw new NotImplementedException();
+                       throw new NotImplementedException ();
                }
        }
-}
+}
\ No newline at end of file