//
-// System.Web.UI.WebControls.LocalFileSettingsProvider.cs
+// System.Configuration.LocalFileSettingsProvider.cs
//
// Authors:
// Chris Toshok (toshok@ximian.com)
//
#if NET_2_0
+#if CONFIGURATION_DEP
+extern alias PrebuiltSystem;
+using NameValueCollection = PrebuiltSystem.System.Collections.Specialized.NameValueCollection;
+#endif
+
using System;
using System.Collections.Specialized;
{
}
+ [MonoTODO]
public SettingsPropertyValue GetPreviousVersion (SettingsContext context,
SettingsProperty property)
{
}
+ [MonoTODO]
public override SettingsPropertyValueCollection GetPropertyValues (SettingsContext context,
SettingsPropertyCollection properties)
{
- throw new NotImplementedException ();
+ SettingsPropertyValueCollection pv = new SettingsPropertyValueCollection ();
+ foreach (SettingsProperty prop in properties)
+ pv.Add (new SettingsPropertyValue (prop));
+
+ return pv;
}
-#if notyet
+#if CONFIGURATION_DEP
public override void Initialize (string name,
NameValueCollection values)
{
- applicationName = values["applicationName"];
+ if (name == null)
+ name = "LocalFileSettingsProvider";
+ if (values != null)
+ applicationName = values["applicationName"];
base.Initialize (name, values);
}
#endif
+ [MonoTODO]
public void Reset (SettingsContext context)
{
throw new NotImplementedException ();
}
+ [MonoTODO]
public override void SetPropertyValues (SettingsContext context,
SettingsPropertyValueCollection values)
{
throw new NotImplementedException ();
}
+ [MonoTODO]
public void Upgrade (SettingsContext context,
SettingsPropertyCollection properties)
{
throw new NotImplementedException ();
}
+ string applicationName = "";
public override string ApplicationName {
- get {
- return applicationName;
- }
- set {
- applicationName = value;
- }
+ get { return applicationName; }
+ set { applicationName = value; }
}
- string applicationName = "";
+ bool IsUserSetting (SettingsProperty prop)
+ {
+#if CONFIGURATION_DEP
+ if (prop.Attributes.ContainsKey (typeof (UserScopedSettingAttribute)))
+ return true;
+ else if (prop.Attributes.ContainsKey (typeof (ApplicationScopedSettingAttribute)))
+ return false;
+ else
+ throw new ConfigurationErrorsException (
+ String.Format ("The setting '{0}' does not have either an ApplicationScopedSettingAttribute or UserScopedSettingAttribute.",
+ prop.Name));
+#else
+ return false;
+#endif
+ }
}
}