New test.
[mono.git] / mcs / class / System.Web / System.Web.Configuration_2.0 / UrlMapping.cs
index e592009fd3948fe122d0e5e8bf87305bca566703..f08cfa5ed7fbea5f92a870c37348adf4d068641d 100644 (file)
@@ -29,6 +29,7 @@
 //
 
 using System;
+using System.ComponentModel;
 using System.Configuration;
 
 #if NET_2_0
@@ -41,16 +42,32 @@ namespace System.Web.Configuration {
                static ConfigurationProperty urlProp;
                static ConfigurationPropertyCollection properties;
 
+               [MonoTODO]
+               static void ValidateUrl (object value)
+               {
+                       /* XXX validate the url */
+               }
+
                static UrlMapping ()
                {
-                       mappedUrlProp = new ConfigurationProperty ("mappedUrl", typeof (string), null, ConfigurationPropertyOptions.IsRequired);
-                       urlProp = new ConfigurationProperty ("url", typeof (string), null, ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey);
+                       mappedUrlProp = new ConfigurationProperty ("mappedUrl", typeof (string), null,
+                                                                  PropertyHelper.WhiteSpaceTrimStringConverter,
+                                                                  PropertyHelper.NonEmptyStringValidator,
+                                                                  ConfigurationPropertyOptions.IsRequired);
+                       urlProp = new ConfigurationProperty ("url", typeof (string), null,
+                                                            PropertyHelper.WhiteSpaceTrimStringConverter,
+                                                            new CallbackValidator (typeof (string), ValidateUrl),
+                                                            ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey);
                        properties = new ConfigurationPropertyCollection ();
 
                        properties.Add (mappedUrlProp);
                        properties.Add (urlProp);
                }
 
+               internal UrlMapping ()
+               {
+               }
+
                public UrlMapping (string url, string mappedUrl)
                {
                        this.Url = url;
@@ -58,6 +75,7 @@ namespace System.Web.Configuration {
                }
 
                [ConfigurationProperty ("mappedUrl", Options = ConfigurationPropertyOptions.IsRequired)]
+               // LAMESPEC: MS lists no validator here but provides one in Properties.
                public string MappedUrl {
                        get { return (string) base [mappedUrlProp];}
                        internal set { base [mappedUrlProp] = value;}