Author: kostat
Date: 2006-05-25 11:38:34 -0400 (Thu, 25 May 2006)
New Revision: 61111

Added:
   
branches/mainsoft/gh1.7/mcs/class/System.Data/Mainsoft.Data.Configuration.jvm/ChangeLog
Modified:
   
branches/mainsoft/gh1.7/mcs/class/System.Data/Mainsoft.Data.Configuration.jvm/ProvidersSectionHandler.cs
Log:
support configuration hierarchy merge

Added: 
branches/mainsoft/gh1.7/mcs/class/System.Data/Mainsoft.Data.Configuration.jvm/ChangeLog
===================================================================
--- 
branches/mainsoft/gh1.7/mcs/class/System.Data/Mainsoft.Data.Configuration.jvm/ChangeLog
     2006-05-25 15:30:29 UTC (rev 61110)
+++ 
branches/mainsoft/gh1.7/mcs/class/System.Data/Mainsoft.Data.Configuration.jvm/ChangeLog
     2006-05-25 15:38:34 UTC (rev 61111)
@@ -0,0 +1,3 @@
+2006-05-25  Konstantin Triger <[EMAIL PROTECTED]>
+
+       * ProvidersSectionHandler.cs: support configuration hierarchy merge.
\ No newline at end of file

Modified: 
branches/mainsoft/gh1.7/mcs/class/System.Data/Mainsoft.Data.Configuration.jvm/ProvidersSectionHandler.cs
===================================================================
--- 
branches/mainsoft/gh1.7/mcs/class/System.Data/Mainsoft.Data.Configuration.jvm/ProvidersSectionHandler.cs
    2006-05-25 15:30:29 UTC (rev 61110)
+++ 
branches/mainsoft/gh1.7/mcs/class/System.Data/Mainsoft.Data.Configuration.jvm/ProvidersSectionHandler.cs
    2006-05-25 15:38:34 UTC (rev 61111)
@@ -77,9 +77,29 @@
                                Hashtable col = (Hashtable) handler.Create 
(parentProvider, null, child);
                                providers.Add(col);
                        }       
-                       if (parent != null && parent is ICollection)
-                               providers.AddRange((ICollection)parent);
+                       if (parent != null && parent is IList) {
+                               IList parentList = (IList)parent;
+                               for (int i = 0; i < parentList.Count; i++) {
+                                       Hashtable htParent = 
(Hashtable)parentList[i];
+                                       string parentId = 
(string)htParent["id"];
+                                       bool overriden = false;
+                                       for (int y = 0; y < providers.Count; 
y++) {
+                                               Hashtable htMe = 
(Hashtable)providers[y];
+                                               string myId = 
(string)htMe["id"];
+                                               if 
(String.CompareOrdinal(parentId,myId) == 0) {
+                                                       overriden = true;
+                                                       foreach (object key in 
htParent.Keys)
+                                                               if 
(!htMe.ContainsKey(key))
+                                                                       
htMe[key] = htParent[key];
+                                                       break;
+                                               }
+                                       }
 
+                                       if (!overriden)
+                                               providers.Add(htParent);
+                               }
+                       }
+
                        return providers;
                }
                

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

Reply via email to