Author: kostat
Date: 2007-01-16 07:36:20 -0500 (Tue, 16 Jan 2007)
New Revision: 71127

Modified:
   
trunk/mcs/class/System.Web/System.Web.Configuration_2.0/ClientTargetCollection.cs
   
trunk/mcs/class/System.Web/System.Web.Configuration_2.0/ClientTargetSection.cs
   
trunk/mcs/class/System.Web/Test/System.Web.Configuration/WebConfigurationManagerTest.cs
Log:
* ClientTargetSection.cs: refactoring.
* ClientTargetCollection.cs: create ClientTarget with null parameters,
        refactoring.


Modified: 
trunk/mcs/class/System.Web/System.Web.Configuration_2.0/ClientTargetCollection.cs
===================================================================
--- 
trunk/mcs/class/System.Web/System.Web.Configuration_2.0/ClientTargetCollection.cs
   2007-01-16 12:27:02 UTC (rev 71126)
+++ 
trunk/mcs/class/System.Web/System.Web.Configuration_2.0/ClientTargetCollection.cs
   2007-01-16 12:36:20 UTC (rev 71127)
@@ -38,13 +38,6 @@
        [ConfigurationCollection (typeof (ClientTarget), CollectionType = 
ConfigurationElementCollectionType.AddRemoveClearMap)]
        public sealed class ClientTargetCollection : 
ConfigurationElementCollection
        {
-               static ConfigurationPropertyCollection properties;
-
-               static ClientTargetCollection ()
-               {
-                       properties = new ConfigurationPropertyCollection ();
-               }
-
                public void Add (ClientTarget clientTarget)
                {
                        BaseAdd (clientTarget);
@@ -57,7 +50,7 @@
 
                protected override ConfigurationElement CreateNewElement ()
                {
-                       return new ClientTarget ("", "");
+                       return new ClientTarget (null, null);
                }
 
                protected override object GetElementKey (ConfigurationElement 
element)
@@ -102,10 +95,6 @@
                public new ClientTarget this [string name] {
                        get { return (ClientTarget) BaseGet (name); }
                }
-
-               protected override ConfigurationPropertyCollection Properties {
-                       get { return properties; }
-               }
        }
 }
 

Modified: 
trunk/mcs/class/System.Web/System.Web.Configuration_2.0/ClientTargetSection.cs
===================================================================
--- 
trunk/mcs/class/System.Web/System.Web.Configuration_2.0/ClientTargetSection.cs  
    2007-01-16 12:27:02 UTC (rev 71126)
+++ 
trunk/mcs/class/System.Web/System.Web.Configuration_2.0/ClientTargetSection.cs  
    2007-01-16 12:36:20 UTC (rev 71127)
@@ -37,27 +37,10 @@
 
        public sealed class ClientTargetSection : ConfigurationSection
        {
-               static ConfigurationProperty clientTargetsProp;
-               static ConfigurationPropertyCollection properties;
-
-               static ClientTargetSection ()
-               {
-                       clientTargetsProp = new ConfigurationProperty ("", 
typeof (ClientTargetCollection), null,
-                                                                      null, 
PropertyHelper.DefaultValidator,
-                                                                      
ConfigurationPropertyOptions.IsDefaultCollection | 
ConfigurationPropertyOptions.IsRequired);
-                       properties = new ConfigurationPropertyCollection ();
-
-                       properties.Add (clientTargetsProp);
-               }
-
                [ConfigurationProperty ("", Options = 
ConfigurationPropertyOptions.IsDefaultCollection | 
ConfigurationPropertyOptions.IsRequired)]
                public ClientTargetCollection ClientTargets {
-                       get { return (ClientTargetCollection) base 
[clientTargetsProp];}
+                       get { return (ClientTargetCollection) base [""];}
                }
-
-               protected override ConfigurationPropertyCollection Properties {
-                       get { return properties; }
-               }
        }
 }
 

Modified: 
trunk/mcs/class/System.Web/Test/System.Web.Configuration/WebConfigurationManagerTest.cs
===================================================================
--- 
trunk/mcs/class/System.Web/Test/System.Web.Configuration/WebConfigurationManagerTest.cs
     2007-01-16 12:27:02 UTC (rev 71126)
+++ 
trunk/mcs/class/System.Web/Test/System.Web.Configuration/WebConfigurationManagerTest.cs
     2007-01-16 12:36:20 UTC (rev 71127)
@@ -38,12 +38,20 @@
 using System.Web.Configuration;
 using System.Web;
 using System.Web.Security;
+using MonoTests.SystemWeb.Framework;
+using System.Web.UI;
 
 namespace MonoTests.System.Web.Configuration {
 
        [TestFixture]
        public class WebConfigurationManagerTest  {
 
+               [TestFixtureTearDown]
+               public void Unload ()
+               {
+                       WebTest.Unload ();
+               }
+
                [Test]
                public void OpenMachineConfiguration_1 ()
                {
@@ -161,6 +169,19 @@
                }
 
                [Test]
+               [Category ("NunitWeb")]
+               public void ClientTarget () {
+                       new WebTest (PageInvoker.CreateOnLoad 
(ClientTarget_load)).Run ();
+               }
+
+               public static void ClientTarget_load (Page p) {
+                       ClientTargetSection sec = (ClientTargetSection) 
WebConfigurationManager.GetSection ("system.web/clientTarget");
+                       ClientTarget clientTarget = sec.ClientTargets 
["downlevel"];
+                       if (clientTarget == null)
+                               Assert.Fail ("ClientTarget Section: downlevel");
+               }
+
+               [Test]
         [Category ("NotWorking")]
                public void OpenMappedMachineConfiguration ()
                {

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

Reply via email to