//
using System;
+using System.ComponentModel;
using System.Configuration;
#if NET_2_0
static ConfigurationProperty pollTimeProp;
static ConfigurationPropertyCollection properties;
+ static ConfigurationElementProperty elementProperty;
+
static SqlCacheDependencyDatabase ()
{
- connectionStringNameProp = new ConfigurationProperty ("connectionStringName", typeof (string), null, ConfigurationPropertyOptions.IsRequired);
- nameProp = new ConfigurationProperty ("name", typeof (string), null, ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey);
+ connectionStringNameProp = new ConfigurationProperty ("connectionStringName", typeof (string), null,
+ TypeDescriptor.GetConverter (typeof (string)),
+ PropertyHelper.NonEmptyStringValidator,
+ ConfigurationPropertyOptions.IsRequired);
+ nameProp = new ConfigurationProperty ("name", typeof (string), null,
+ TypeDescriptor.GetConverter (typeof (string)),
+ PropertyHelper.NonEmptyStringValidator,
+ ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey);
pollTimeProp = new ConfigurationProperty ("pollTime", typeof (int), 60000);
properties = new ConfigurationPropertyCollection ();
properties.Add (connectionStringNameProp);
properties.Add (nameProp);
properties.Add (pollTimeProp);
+
+ elementProperty = new ConfigurationElementProperty (new CallbackValidator (typeof (SqlCacheDependencyDatabase), ValidateElement));
}
internal SqlCacheDependencyDatabase ()
this.PollTime = pollTime;
}
+ [MonoTODO]
+ static void ValidateElement (object o)
+ {
+ /* XXX do some sort of element validation here? */
+ }
+
+ protected override ConfigurationElementProperty ElementProperty {
+ get { return elementProperty; }
+ }
+
[StringValidator (MinLength = 1)]
[ConfigurationProperty ("connectionStringName", Options = ConfigurationPropertyOptions.IsRequired)]
public string ConnectionStringName {
set { base[connectionStringNameProp] = value; }
}
-#if notyet
- protected override ConfigurationElementProperty ElementProperty {
- get { throw new NotImplementedException (); }
- }
-#endif
-
[StringValidator (MinLength = 1)]
[ConfigurationProperty ("name", Options = ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey)]
public string Name {