Class SettingsProviderBase
Represents a base for a SettingsProvider with XML file handling.
public abstract class SettingsProviderBase : SettingsProvider, IApplicationSettingsProvider
- Inheritance
-
SettingsProviderBase
- Implements
- Derived
- Inherited Members
- Extension Methods
Properties
ApplicationName
Gets or sets the name for the executing assembly.
public override string ApplicationName { get; set; }
Property Value
FilePath
Gets the name for the path.
protected abstract string FilePath { get; }
Property Value
Name
Gets the name of the provider.
public override abstract string Name { get; }
Property Value
Methods
GetGlobalSettingsNode()
Gets the global settings node.
protected virtual XmlNode GetGlobalSettingsNode()
Returns
- XmlNode
Global settings node.
GetLocalSettingsNode()
Gets the local settings node.
protected virtual XmlNode GetLocalSettingsNode()
Returns
- XmlNode
Local settings node.
GetPreviousVersion(SettingsContext, SettingsProperty)
Returns the value of the specified settings property for the previous version of the same application.
public SettingsPropertyValue GetPreviousVersion(SettingsContext context, SettingsProperty property)
Parameters
context
SettingsContextA SettingsContext describing the current application usage.
property
SettingsPropertyThe SettingsProperty whose value is to be returned.
Returns
- SettingsPropertyValue
Get the value for th previous version.
GetPropertyValues(SettingsContext, SettingsPropertyCollection)
Returns the collection of settings property values for the specified application instance and settings property group.
public override SettingsPropertyValueCollection GetPropertyValues(SettingsContext context, SettingsPropertyCollection collection)
Parameters
context
SettingsContextA SettingsContext describing the current application use.
collection
SettingsPropertyCollectionA System.Configuration.SettingsPropertyCollection containing the settings property group whose values are to be retrieved.
Returns
- SettingsPropertyValueCollection
The values for the specified settings property group.
Initialize(string, NameValueCollection)
Initializes the provider.
public override void Initialize(string name, NameValueCollection config)
Parameters
name
stringThe friendly name of the provider.
config
NameValueCollectionA collection of the name/value pairs representing the provider-specific attributes specified in the configuration for this provider.
Reset(SettingsContext)
Resets the local and global settings nodes.
public void Reset(SettingsContext context)
Parameters
context
SettingsContextA SettingsContext describing the current application usage.
SetPropertyValues(SettingsContext, SettingsPropertyValueCollection)
Sets the values of the specified group of property settings.
public override void SetPropertyValues(SettingsContext context, SettingsPropertyValueCollection collection)
Parameters
context
SettingsContextA SettingsContext describing the current application usage.
collection
SettingsPropertyValueCollectionA SettingsPropertyValueCollection representing the group of property settings to set.
Upgrade(SettingsContext, SettingsPropertyCollection)
Upgrades the provider.
public void Upgrade(SettingsContext context, SettingsPropertyCollection properties)
Parameters
context
SettingsContextA SettingsContext describing the current application usage.
properties
SettingsPropertyCollectionA SettingsPropertyCollection containing the settings property group whose values are to be retrieved.
Remarks
Nothing will be done here.