//
using System;
+using System.ComponentModel;
using System.Configuration;
#if NET_2_0
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;
}
[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;}