Author: igorz
Date: 2007-05-15 11:43:02 -0400 (Tue, 15 May 2007)
New Revision: 77419

Modified:
   trunk/mcs/class/System.Configuration/System.Configuration/ChangeLog
   trunk/mcs/class/System.Configuration/System.Configuration/Configuration.cs
   
trunk/mcs/class/System.Configuration/System.Configuration/ConfigurationLocation.cs
Log:
2007-05-15 Igor Zelmanovich <[EMAIL PROTECTED]>

        * Configuration.cs:
        * ConfigurationLocation.cs:
        implemented EvaluationContext property.         


Modified: trunk/mcs/class/System.Configuration/System.Configuration/ChangeLog
===================================================================
--- trunk/mcs/class/System.Configuration/System.Configuration/ChangeLog 
2007-05-15 15:12:00 UTC (rev 77418)
+++ trunk/mcs/class/System.Configuration/System.Configuration/ChangeLog 
2007-05-15 15:43:02 UTC (rev 77419)
@@ -1,5 +1,11 @@
 2007-05-15 Igor Zelmanovich <[EMAIL PROTECTED]>
 
+       * Configuration.cs:
+       * ConfigurationLocation.cs:
+       implemented EvaluationContext property.         
+
+2007-05-15 Igor Zelmanovich <[EMAIL PROTECTED]>
+
        * ConfigurationLocationCollection.cs: for TARGET_JVM only:
        location path is case-insensitive.
                

Modified: 
trunk/mcs/class/System.Configuration/System.Configuration/Configuration.cs
===================================================================
--- trunk/mcs/class/System.Configuration/System.Configuration/Configuration.cs  
2007-05-15 15:12:00 UTC (rev 77418)
+++ trunk/mcs/class/System.Configuration/System.Configuration/Configuration.cs  
2007-05-15 15:43:02 UTC (rev 77419)
@@ -51,12 +51,14 @@
                
                string configPath;
                string locationConfigPath;
-                       
-               internal Configuration (Configuration parent)
+               string locationSubPath;
+
+               internal Configuration (Configuration parent, string 
locationSubPath)
                {
                        this.parent = parent;
                        this.system = parent.system;
                        this.rootGroup = parent.rootGroup;
+                       this.locationSubPath = locationSubPath;
                }
                
                internal Configuration (InternalConfigurationSystem system, 
string locationSubPath)
@@ -140,6 +142,19 @@
                        get { return locationConfigPath; }
                }
 
+               internal string GetLocationSubPath ()
+               {
+                       Configuration confg = parent;
+                       string path = null;
+                       while (confg != null) {
+                               path = confg.locationSubPath;
+                               if (!String.IsNullOrEmpty (path))
+                                       return path;
+                               confg = confg.parent;
+                       }
+                       return path;
+               }
+
                internal string ConfigPath {
                        get { return configPath; }
                }
@@ -162,12 +177,15 @@
                        }
                }
 
-               [MonoTODO ("HostingContext")]
                ContextInformation evaluationContext;
                public ContextInformation EvaluationContext {
                        get {
-                               if (evaluationContext == null)
-                                       evaluationContext = new 
ContextInformation (this, null /* XXX */);
+                               if (evaluationContext == null) {
+                                       object ctx = 
system.Host.CreateConfigurationContext (configPath, GetLocationSubPath() );
+                                       evaluationContext = new 
ContextInformation (this, ctx);
+                               }
+
+
                                return evaluationContext;
                        }
                }
@@ -407,7 +425,7 @@
                
                bool Load ()
                {
-                       if (streamName == null || streamName == "")
+                       if (String.IsNullOrEmpty (streamName))
                                return true;
 
                        XmlTextReader reader = null;

Modified: 
trunk/mcs/class/System.Configuration/System.Configuration/ConfigurationLocation.cs
===================================================================
--- 
trunk/mcs/class/System.Configuration/System.Configuration/ConfigurationLocation.cs
  2007-05-15 15:12:00 UTC (rev 77418)
+++ 
trunk/mcs/class/System.Configuration/System.Configuration/ConfigurationLocation.cs
  2007-05-15 15:43:02 UTC (rev 77419)
@@ -82,7 +82,7 @@
                                        }
                                }
                                
-                               configuration = new Configuration (parent);
+                               configuration = new Configuration (parent, 
path);
                                using (XmlTextReader tr = new XmlTextReader 
(new StringReader (xmlContent)))
                                        configuration.ReadData (tr, 
allowOverride);
 

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

Reply via email to