Acts as a base class for deriving concrete wrapper classes to implement the application settings feature in Window Forms applications.
See Also: ApplicationSettingsBase Members
System.Configuration.ApplicationSettingsBase adds the following functionality to the System.Configuration.SettingsBase class, which is used by Web-based applications:
The ability to detect attributes on a derived, settings wrapper class. System.Configuration.ApplicationSettingsBase supports the declarative model used for wrapper class properties, as described later.
Higher-level ApplicationSettingsBase.Save and ApplicationSettingsBase.Reload methods.
Additional validation events that you can handle to ensure the correctness of individual settings.
In the application settings architecture, to access a group of settings properties you need to derive a concrete wrapper class from System.Configuration.ApplicationSettingsBase. The wrapper class customizes System.Configuration.ApplicationSettingsBase in the following ways:
For every settings property to be accessed, a corresponding strongly typed public property is added to the wrapper class. This property has get and set accessors for read/write application settings, but only a get accessor for read-only settings.
Appropriated attributes must be applied to the wrapper class's public properties to indicate characteristics of the settings property, such as the setting's scope (application or user), whether the setting should support roaming, the default value for the setting, the settings provider to be used, and so on. Each property is required to specify its scope, using either System.Configuration.ApplicationScopedSettingAttribute or System.Configuration.UserScopedSettingAttribute. Application-scoped settings are read-only if the default System.Configuration.LocalFileSettingsProvider is used.
The System.Configuration.ApplicationSettingsBase class uses reflection to detect these attributes at run time. Most of this information gets passed to the settings provider layer, which is responsible for storage, persistence format, and so on.
When an application has multiple settings wrapper classes, each class defines a settings group. Each group has the following characteristics:
A group can contain any number or type of property settings.
If the group name is not explicitly set by the decorating the wrapper class with a System.Configuration.SettingsGroupNameAttribute, then a name is automatically generated.
By default, all client-based applications use the System.Configuration.LocalFileSettingsProvider to provide storage. If an alternate settings provider is desired, then the wrapper class or property must be decorated with a corresponding System.Configuration.SettingsProviderAttribute.
For more information about using application settings, see Application Settings for Windows Forms.