fix typo in WriteAccessProperties prop name; clone the returned value; attach a corre...
authorKonstantin Triger <kostat@mono-cvs.ximian.com>
Thu, 2 Aug 2007 09:07:38 +0000 (09:07 -0000)
committerKonstantin Triger <kostat@mono-cvs.ximian.com>
Thu, 2 Aug 2007 09:07:38 +0000 (09:07 -0000)
svn path=/trunk/mcs/; revision=83269

mcs/class/System.Web.Extensions/System.Web.Configuration/ScriptingProfileServiceSection.cs

index e1b85b123e4532b472a13dcfe9a72255754dad2c..efa73c20a91be50e1e35180a6312f64d93487543 100644 (file)
@@ -31,6 +31,8 @@ using System;
 using System.Collections.Generic;
 using System.Text;
 using System.Configuration;
+using System.ComponentModel;
+using System.Web.UI.WebControls;
 
 namespace System.Web.Configuration
 {
@@ -47,7 +49,20 @@ namespace System.Web.Configuration
                }
 
                [ConfigurationPropertyAttribute ("readAccessProperties", DefaultValue = null)]
+               [TypeConverter(typeof(StringArrayConverter))]
                public string [] ReadAccessProperties {
+                       get {
+                               string [] data = ReadAccessPropertiesNoCopy;
+                               return (string []) data.Clone ();
+                       }
+                       set {
+                               if (value != null)
+                                       value = (string []) value.Clone ();
+                               ReadAccessPropertiesNoCopy = value;
+                       }
+               }
+
+               internal string [] ReadAccessPropertiesNoCopy {
                        get {
                                return (string []) this ["readAccessProperties"];
                        }
@@ -56,13 +71,26 @@ namespace System.Web.Configuration
                        }
                }
 
-               [ConfigurationPropertyAttribute ("writeAccessProperites", DefaultValue = null)]
+               [ConfigurationPropertyAttribute ("writeAccessProperties", DefaultValue = null)]
+               [TypeConverter (typeof (StringArrayConverter))]
                public string [] WriteAccessProperties {
                        get {
-                               return (string []) this ["writeAccessProperites"];
+                               string [] data = WriteAccessPropertiesNoCopy;
+                               return (string []) data.Clone ();
+                       }
+                       set {
+                               if (value != null)
+                                       value = (string []) value.Clone ();
+                               WriteAccessPropertiesNoCopy = value;
+                       }
+               }
+
+               internal string [] WriteAccessPropertiesNoCopy {
+                       get {
+                               return (string []) this ["writeAccessProperties"];
                        }
                        set {
-                               this ["writeAccessProperites"] = value;
+                               this ["writeAccessProperties"] = value;
                        }
                }
        }