Author: mhabersack
Date: 2007-12-27 07:47:04 -0500 (Thu, 27 Dec 2007)
New Revision: 91931

Modified:
   trunk/mcs/class/System.Web/System.Web.Configuration_2.0/ChangeLog
   
trunk/mcs/class/System.Web/System.Web.Configuration_2.0/ProfileGroupSettings.cs
   
trunk/mcs/class/System.Web/System.Web.Configuration_2.0/ProfileGroupSettingsCollection.cs
   trunk/mcs/class/System.Web/System.Web.Configuration_2.0/ProfileSection.cs
   
trunk/mcs/class/System.Web/System.Web.Configuration_2.0/RootProfilePropertySettingsCollection.cs
Log:
2007-12-27  Marek Habersack  <[EMAIL PROTECTED]>

        * ProfileGroupSettingsCollection.cs: added an internal method to
        add/overwrite new group settings. Used from
        RootProfilePropertySettingsCollection.

        * ProfileGroupSettings.cs: added the missing "name" property to
        the properties collection.
        Marked the propertySettingsProp property as the default
        collection.
        Added internal deserialization method, used from
        RootProfilePropertySettingsCollection to support the 'group'
        element.

        * ProfileSection.cs: defaultProviderProp typo - the name of the
        provider should be "AspNetSqlProfileProvider"

        * RootProfilePropertySettingsCollection.cs: added
        OnDeseerializeUnrecognizedElement to support the profile 'group'
        element.
        Added a missing Unmerge method.


Modified: trunk/mcs/class/System.Web/System.Web.Configuration_2.0/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.Configuration_2.0/ChangeLog   
2007-12-27 11:44:16 UTC (rev 91930)
+++ trunk/mcs/class/System.Web/System.Web.Configuration_2.0/ChangeLog   
2007-12-27 12:47:04 UTC (rev 91931)
@@ -1,3 +1,25 @@
+2007-12-27  Marek Habersack  <[EMAIL PROTECTED]>
+
+       * ProfileGroupSettingsCollection.cs: added an internal method to
+       add/overwrite new group settings. Used from
+       RootProfilePropertySettingsCollection.
+
+       * ProfileGroupSettings.cs: added the missing "name" property to
+       the properties collection.
+       Marked the propertySettingsProp property as the default
+       collection.
+       Added internal deserialization method, used from
+       RootProfilePropertySettingsCollection to support the 'group'
+       element.
+
+       * ProfileSection.cs: defaultProviderProp typo - the name of the
+       provider should be "AspNetSqlProfileProvider"
+
+       * RootProfilePropertySettingsCollection.cs: added
+       OnDeseerializeUnrecognizedElement to support the profile 'group'
+       element.
+       Added a missing Unmerge method.
+
 2007-12-11  Vladimir Krasnov  <[EMAIL PROTECTED]>
 
        * SiteMapSection.cs: fixed ProvidersInternal property to be thread safe

Modified: 
trunk/mcs/class/System.Web/System.Web.Configuration_2.0/ProfileGroupSettings.cs
===================================================================
--- 
trunk/mcs/class/System.Web/System.Web.Configuration_2.0/ProfileGroupSettings.cs 
    2007-12-27 11:44:16 UTC (rev 91930)
+++ 
trunk/mcs/class/System.Web/System.Web.Configuration_2.0/ProfileGroupSettings.cs 
    2007-12-27 12:47:04 UTC (rev 91931)
@@ -33,21 +33,27 @@
 using System;
 using System.ComponentModel;
 using System.Configuration;
+using System.Xml;
 
 namespace System.Web.Configuration
 {
        public sealed class ProfileGroupSettings : ConfigurationElement
        {
                static ConfigurationProperty propertySettingsProp;
+               static ConfigurationProperty nameProp;
                
                static ConfigurationPropertyCollection properties;
                
                static ProfileGroupSettings ()
                {
-                       propertySettingsProp = new ConfigurationProperty (null, 
typeof (ProfilePropertySettingsCollection), null);
-
+                       propertySettingsProp = new ConfigurationProperty (null, 
typeof (ProfilePropertySettingsCollection), null, null, null,
+                                                                         
ConfigurationPropertyOptions.IsDefaultCollection);
+                       nameProp = new ConfigurationProperty ("name", typeof 
(string), null, null, PropertyHelper.NonEmptyStringValidator,
+                                                             
ConfigurationPropertyOptions.IsKey | ConfigurationPropertyOptions.IsRequired);
+                       
                        properties = new ConfigurationPropertyCollection ();
                        properties.Add (propertySettingsProp);
+                       properties.Add (nameProp);
                }
                
                internal ProfileGroupSettings ()
@@ -76,10 +82,15 @@
                        return Name.GetHashCode ();
                }
 
+               internal void DoDeserialize (XmlReader reader)
+               {
+                       DeserializeElement (reader, false);
+               }
+               
                [ConfigurationProperty ("name", IsRequired = true, IsKey = 
true)]
                public string Name {
-                       get { return (string)base ["name"]; }
-                       internal set { base ["name"] = value; }
+                       get { return (string)base [nameProp]; }
+                       internal set { base [nameProp] = value; }
                }
 
                [ConfigurationProperty ("", Options = 
ConfigurationPropertyOptions.IsDefaultCollection)]

Modified: 
trunk/mcs/class/System.Web/System.Web.Configuration_2.0/ProfileGroupSettingsCollection.cs
===================================================================
--- 
trunk/mcs/class/System.Web/System.Web.Configuration_2.0/ProfileGroupSettingsCollection.cs
   2007-12-27 11:44:16 UTC (rev 91930)
+++ 
trunk/mcs/class/System.Web/System.Web.Configuration_2.0/ProfileGroupSettingsCollection.cs
   2007-12-27 12:47:04 UTC (rev 91931)
@@ -148,6 +148,12 @@
                {
                        Reset (parentElement);
                }
+
+               internal void AddNewSettings (ProfileGroupSettings newSettings)
+               {
+                       // allow overriding - no exception should be thrown
+                       BaseAdd (newSettings, false);
+               }
        }
 
 }

Modified: 
trunk/mcs/class/System.Web/System.Web.Configuration_2.0/ProfileSection.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.Configuration_2.0/ProfileSection.cs   
2007-12-27 11:44:16 UTC (rev 91930)
+++ trunk/mcs/class/System.Web/System.Web.Configuration_2.0/ProfileSection.cs   
2007-12-27 12:47:04 UTC (rev 91931)
@@ -50,7 +50,7 @@
                {
                        automaticSaveEnabledProp = new ConfigurationProperty 
("automaticSaveEnabled", typeof (bool), true);
                        defaultProviderProp = new ConfigurationProperty 
("defaultProvider", typeof (string),
-                                                                        
"AspnetSqlProfileProvider");
+                                                                        
"AspNetSqlProfileProvider");
                        enabledProp = new ConfigurationProperty ("enabled", 
typeof (bool), true);
                        inheritsProp = new ConfigurationProperty ("inherits", 
typeof (string), "");
                        propertySettingsProp = new ConfigurationProperty 
("properties", typeof (RootProfilePropertySettingsCollection));

Modified: 
trunk/mcs/class/System.Web/System.Web.Configuration_2.0/RootProfilePropertySettingsCollection.cs
===================================================================
--- 
trunk/mcs/class/System.Web/System.Web.Configuration_2.0/RootProfilePropertySettingsCollection.cs
    2007-12-27 11:44:16 UTC (rev 91930)
+++ 
trunk/mcs/class/System.Web/System.Web.Configuration_2.0/RootProfilePropertySettingsCollection.cs
    2007-12-27 12:47:04 UTC (rev 91931)
@@ -40,7 +40,6 @@
        public sealed class RootProfilePropertySettingsCollection : 
ProfilePropertySettingsCollection
        {
                static ConfigurationPropertyCollection properties;
-
                ProfileGroupSettingsCollection groupSettings;
                
                static RootProfilePropertySettingsCollection ()
@@ -83,6 +82,29 @@
                protected override bool AllowClear {
                        get { return true; }
                }
+
+               // LAMESPEC: this is missing from MSDN but is present in 2.0sp1 
version of the
+               // class.
+               protected override bool OnDeserializeUnrecognizedElement 
(string elementName, XmlReader reader)
+               {
+                       if (elementName == "group") {
+                               ProfileGroupSettings newSettings = new 
ProfileGroupSettings ();
+                               newSettings.DoDeserialize (reader);
+                               GroupSettings.AddNewSettings (newSettings);
+                               
+                               return true;
+                       }
+                       
+                       return base.OnDeserializeUnrecognizedElement 
(elementName, reader);
+               }
+
+               // LAMESPEC: this is missing from MSDN, but is present in the 
2.0sp1 version of the
+               // class
+               protected override void Unmerge (ConfigurationElement 
sourceElement, ConfigurationElement parentElement, ConfigurationSaveMode 
saveMode)
+               {
+                       // Why override?
+                       base.Unmerge (sourceElement, parentElement, saveMode);
+               }
                
                [ConfigurationProperty ("group")]
                public ProfileGroupSettingsCollection GroupSettings {

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

Reply via email to