Author: kostat
Date: 2007-01-11 11:16:50 -0500 (Thu, 11 Jan 2007)
New Revision: 70861

Modified:
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSource.cs
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSource.cs
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/XmlDataSource.cs
Log:
* XmlDataSource.cs: refactored to use cached collection.
* SqlDataSource.cs: refactored to use cached collection;
        don't throw exception on 'DefaultView'.
* ObjectDataSource.cs: refactored to use cached collection.


Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog      
2007-01-11 14:15:20 UTC (rev 70860)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog      
2007-01-11 16:16:50 UTC (rev 70861)
@@ -1,5 +1,12 @@
 2007-01-10 Konstantin Triger <[EMAIL PROTECTED]>
 
+       * XmlDataSource.cs: refactored to use cached collection.
+       * SqlDataSource.cs: refactored to use cached collection;
+               don't throw exception on 'DefaultView'.
+       * ObjectDataSource.cs: refactored to use cached collection.
+
+2007-01-10 Konstantin Triger <[EMAIL PROTECTED]>
+
         * ObjectDataSourceView.cs: consider parameter names and
                        DataObjectMethodAttribute during method resolution.
 

Modified: 
trunk/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSource.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSource.cs    
2007-01-11 14:15:20 UTC (rev 70860)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSource.cs    
2007-01-11 16:16:50 UTC (rev 70861)
@@ -49,7 +49,7 @@
        [ToolboxBitmap ("bitmap file goes here")]
        public class ObjectDataSource : DataSourceControl
        {
-               static readonly string defaultViewName = "DefaultView";
+               static readonly string [] emptyNames = new string [] { 
"DefaultView" };
                ObjectDataSourceView defaultView;
                
                int cacheDuration = 0;
@@ -72,7 +72,7 @@
                ObjectDataSourceView DefaultView {
                        get {
                                if (defaultView == null)
-                                       defaultView = new ObjectDataSourceView 
(this, defaultViewName, Context);
+                                       defaultView = new ObjectDataSourceView 
(this, emptyNames [0], Context);
                                return defaultView;
                        }
                }
@@ -364,7 +364,7 @@
                
                protected override ICollection GetViewNames ()
                {
-                       return new string [] { defaultViewName };
+                       return emptyNames;
                }
                
                public IEnumerable Select ()

Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSource.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSource.cs       
2007-01-11 14:15:20 UTC (rev 70860)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSource.cs       
2007-01-11 16:16:50 UTC (rev 70861)
@@ -50,6 +50,8 @@
        [DesignerAttribute 
("System.Web.UI.Design.WebControls.SqlDataSourceDesigner, " + 
Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
        [DefaultEventAttribute ("Selecting")]
        public class SqlDataSource : DataSourceControl {
+
+               static readonly string [] emptyNames = new string [] { 
"DefaultView" };
                
                public SqlDataSource ()
                {
@@ -70,7 +72,7 @@
 
                protected override DataSourceView GetView (string viewName)
                {
-                       if (viewName == "" || viewName == null)
+                       if (String.IsNullOrEmpty (viewName) || (String.Compare 
(viewName, emptyNames [0], StringComparison.InvariantCultureIgnoreCase) == 0))
                                return View;
                        else
                                throw new ArgumentException ("viewName");
@@ -108,7 +110,7 @@
 
                protected override ICollection GetViewNames ()
                {
-                       return new string [] { "DefaultView" };
+                       return emptyNames;
                }
                        
                public int Insert ()

Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/XmlDataSource.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/XmlDataSource.cs       
2007-01-11 14:15:20 UTC (rev 70860)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/XmlDataSource.cs       
2007-01-11 16:16:50 UTC (rev 70861)
@@ -65,6 +65,7 @@
                private bool _enableCaching = true;
                private int _cacheDuration = 0;
                private DataSourceCacheExpiry _cacheExpirationPolicy = 
DataSourceCacheExpiry.Absolute;
+               static readonly string [] emptyNames = new string [] { 
"DefaultView" };
                
                event EventHandler IDataSource.DataSourceChanged {
                        add { ((IHierarchicalDataSource)this).DataSourceChanged 
+= value; }
@@ -235,7 +236,7 @@
                
                ICollection IDataSource.GetViewNames ()
                {
-                       return new string [] { "DefaultView" };
+                       return emptyNames;
                }
                
                [DefaultValue (0)]

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to