Browse Source

2005-11-14 Chris Toshok <[email protected]>

	* BufferModeSettings.cs: add validators/converters to the
	programmatic property list.
	
	* BuildProvider.cs: add validators/converters to the programmatic
	property list, and add an internal ctor with no args.

	* Compiler.cs: wrap the code i hacked from the 1.1 stuff with a
	#region.

	* BuildProviderCollection.cs (CreateNewElement): use the internal
	BuildProvider ctor to get around validation.

	* AssemblyCollection.cs: same.


svn path=/trunk/mcs/; revision=53037
Chris Toshok 20 years ago
parent
commit
e67c2cf793

+ 1 - 1
mcs/class/System.Web/System.Web.Configuration_2.0/AssemblyCollection.cs

@@ -58,7 +58,7 @@ namespace System.Web.Configuration
 		
 		protected override ConfigurationElement CreateNewElement ()
 		{
-			return new AssemblyInfo ("");
+			return new AssemblyInfo ();
 		}
 		
 		protected override object GetElementKey (ConfigurationElement element)

+ 17 - 7
mcs/class/System.Web/System.Web.Configuration_2.0/BufferModeSettings.cs

@@ -49,13 +49,23 @@ namespace System.Web.Configuration {
 
 		static BufferModeSettings ()
 		{
-			maxBufferSizeProp = new ConfigurationProperty ("maxBufferSize", typeof (int), Int32.MaxValue, ConfigurationPropertyOptions.IsRequired);
-			maxBufferThreadsProp = new ConfigurationProperty ("maxBufferThreads", typeof (int), 1);
-			maxFlushSizeProp = new ConfigurationProperty ("maxFlushSize", typeof (int), Int32.MaxValue, ConfigurationPropertyOptions.IsRequired);
-			nameProp = new ConfigurationProperty ("name", typeof (string), "", ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey);
-			regularFlushIntervalProp = new ConfigurationProperty ("regularFlushInterval", typeof (TimeSpan), TimeSpan.FromSeconds (1), ConfigurationPropertyOptions.IsRequired);
-			urgentFlushIntervalProp = new ConfigurationProperty ("urgentFlushInterval", typeof (TimeSpan), TimeSpan.FromSeconds (0), ConfigurationPropertyOptions.IsRequired);
-			urgentFlushThresholdProp = new ConfigurationProperty ("urgentFlushThreshold", typeof (int), Int32.MaxValue, ConfigurationPropertyOptions.IsRequired);
+			InfiniteIntConverter infIntCvt = new InfiniteIntConverter ();
+			IntegerValidator iv = new IntegerValidator (1, Int32.MaxValue);
+			InfiniteTimeSpanConverter infTSCvt = new InfiniteTimeSpanConverter ();
+			
+			maxBufferSizeProp = new ConfigurationProperty ("maxBufferSize", typeof (int), Int32.MaxValue, infIntCvt, iv, ConfigurationPropertyOptions.IsRequired);
+			maxBufferThreadsProp = new ConfigurationProperty ("maxBufferThreads", typeof (int), 1, infIntCvt, iv, ConfigurationPropertyOptions.None);
+			maxFlushSizeProp = new ConfigurationProperty ("maxFlushSize", typeof (int), Int32.MaxValue, infIntCvt, iv, ConfigurationPropertyOptions.IsRequired);
+			nameProp = new ConfigurationProperty ("name", typeof (string), "", null, new StringValidator (1), ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey);
+			regularFlushIntervalProp = new ConfigurationProperty ("regularFlushInterval", typeof (TimeSpan), TimeSpan.FromSeconds (1),
+									      infTSCvt, new TimeSpanValidator (TimeSpan.Zero, TimeSpan.MaxValue),
+									      ConfigurationPropertyOptions.IsRequired);
+			urgentFlushIntervalProp = new ConfigurationProperty ("urgentFlushInterval", typeof (TimeSpan), TimeSpan.FromSeconds (0),
+									     infTSCvt, null,
+									     ConfigurationPropertyOptions.IsRequired);
+			urgentFlushThresholdProp = new ConfigurationProperty ("urgentFlushThreshold", typeof (int), Int32.MaxValue,
+									      infIntCvt, iv,
+									      ConfigurationPropertyOptions.IsRequired);
 			properties = new ConfigurationPropertyCollection ();
 
 			properties.Add (maxBufferSizeProp);

+ 7 - 2
mcs/class/System.Web/System.Web.Configuration_2.0/BuildProvider.cs

@@ -43,14 +43,19 @@ namespace System.Web.Configuration
 
 		static BuildProvider ()
 		{
-			extensionProp = new ConfigurationProperty ("extension", typeof (string), "", ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey);
-			typeProp = new ConfigurationProperty ("type", typeof (string), "", ConfigurationPropertyOptions.IsRequired);
+			StringValidator sv = new StringValidator (1);
+			extensionProp = new ConfigurationProperty ("extension", typeof (string), "", null, sv, ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey);
+			typeProp = new ConfigurationProperty ("type", typeof (string), "", null, sv, ConfigurationPropertyOptions.IsRequired);
 			properties = new ConfigurationPropertyCollection();
 
 			properties.Add (extensionProp);
 			properties.Add (typeProp);
 		}
 
+		internal BuildProvider ()
+		{
+		}
+
 		public BuildProvider (string extension, string type)
 		{
 			this.Extension = extension;

+ 1 - 1
mcs/class/System.Web/System.Web.Configuration_2.0/BuildProviderCollection.cs

@@ -84,7 +84,7 @@ namespace System.Web.Configuration
 
 		protected override ConfigurationElement CreateNewElement ()
 		{
-			return new BuildProvider (null, null);
+			return new BuildProvider ();
 		}
 
 		protected override object GetElementKey (ConfigurationElement element)

+ 16 - 0
mcs/class/System.Web/System.Web.Configuration_2.0/ChangeLog

@@ -1,3 +1,19 @@
+2005-11-14  Chris Toshok  <[email protected]>
+
+	* BufferModeSettings.cs: add validators/converters to the
+	programmatic property list.
+	
+	* BuildProvider.cs: add validators/converters to the programmatic
+	property list, and add an internal ctor with no args.
+
+	* Compiler.cs: wrap the code i hacked from the 1.1 stuff with a
+	#region.
+
+	* BuildProviderCollection.cs (CreateNewElement): use the internal
+	BuildProvider ctor to get around validation.
+
+	* AssemblyCollection.cs: same.
+
 2005-11-14  Chris Toshok  <[email protected]>
 
 	* TagPrefixCollection.cs (Remove): pass the key to BaseRemove.

+ 2 - 0
mcs/class/System.Web/System.Web.Configuration_2.0/Compiler.cs

@@ -110,6 +110,7 @@ namespace System.Web.Configuration
 			get { return properties; }
 		}
 
+#region CompatabilityCode
 		[MonoTODO ("we shouldn't need this")]
 		CodeDomProvider provider;
 		internal CodeDomProvider Provider {
@@ -124,6 +125,7 @@ namespace System.Web.Configuration
 				provider = value;
 			}
 		}
+#endregion
 	}
 }