2006-11-22 Miguel de Icaza <miguel@novell.com>
[mono.git] / mcs / class / System.Web / System.Web.Configuration_2.0 / CacheSection.cs
index fe719260c24ef5fce787f4a20db4d3ed26d3d08c..34fb7bf7ea479d46eb9da2b557e596d0d8049738 100644 (file)
@@ -51,13 +51,18 @@ namespace System.Web.Configuration {
                        disableMemoryCollectionProp = new ConfigurationProperty("disableMemoryCollection", typeof (bool), false);
                        percentagePhysicalMemoryUsedLimitProp = new ConfigurationProperty("percentagePhysicalMemoryUsedLimit", typeof (int), 89,
                                                                                          TypeDescriptor.GetConverter (typeof (int)),
-                                                                                         new IntegerValidator (0, Int32.MaxValue),
+                                                                                         PropertyHelper.IntFromZeroToMaxValidator,
                                                                                          ConfigurationPropertyOptions.None);
-                       privateBytesLimitProp = new ConfigurationProperty("privateBytesLimit", typeof (long), 0,
+                       privateBytesLimitProp = new ConfigurationProperty("privateBytesLimit", typeof (long), 0L,
                                                                          TypeDescriptor.GetConverter (typeof (long)),
                                                                          new LongValidator (0, Int64.MaxValue),
                                                                          ConfigurationPropertyOptions.None);
-                       privateBytesPollTimeProp = new ConfigurationProperty("privateBytesPollTime", typeof (TimeSpan), TimeSpan.FromMinutes (2));
+                       privateBytesPollTimeProp = new ConfigurationProperty("privateBytesPollTime",
+                                                                            typeof (TimeSpan),
+                                                                            TimeSpan.FromMinutes (2),
+                                                                            PropertyHelper.InfiniteTimeSpanConverter,
+                                                                            PropertyHelper.PositiveTimeSpanValidator,
+                                                                            ConfigurationPropertyOptions.None);
                        properties = new ConfigurationPropertyCollection();
 
                        properties.Add (disableExpirationProp);
@@ -86,7 +91,7 @@ namespace System.Web.Configuration {
                        set { base[percentagePhysicalMemoryUsedLimitProp] = value; }
                }
 
-               [LongValidator (MinValue = 0, MaxValue = Int64.MaxValue)]
+               [LongValidator (MinValue = (long) 0, MaxValue = Int64.MaxValue)]
                [ConfigurationProperty ("privateBytesLimit", DefaultValue = "0")]
                public long PrivateBytesLimit {
                        get { return (long) base [privateBytesLimitProp];}
@@ -95,6 +100,7 @@ namespace System.Web.Configuration {
 
                [TypeConverter (typeof (InfiniteTimeSpanConverter))]
                [ConfigurationProperty ("privateBytesPollTime", DefaultValue = "00:02:00")]
+               // LAMESPEC: MS lists no validator here but provides one in Properties.
                public TimeSpan PrivateBytesPollTime {
                        get { return (TimeSpan) base [privateBytesPollTimeProp];}
                        set { base[privateBytesPollTimeProp] = value; }