// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0
using System;
using System.Collections;
#if (CONFIGURATION_DEP)
: ProviderCollection
#endif
{
- Hashtable providers;
-
public SettingsProviderCollection ()
{
- providers = new Hashtable ();
}
#if (CONFIGURATION_DEP)
public override void Add (ProviderBase provider)
{
- providers.Add (provider.Name, provider);
+ if (!(provider is SettingsProvider))
+ throw new ArgumentException ("SettingsProvider is expected");
+ if (String.IsNullOrEmpty (provider.Name))
+ throw new ArgumentException ("Provider name cannot be null or empty");
+ base.Add (provider);
}
-#endif
public new SettingsProvider this [ string name ] {
get {
- return (SettingsProvider)providers [ name ];
+ return (SettingsProvider) base [ name ];
}
}
+#endif
}
}
-#endif