ApplicationSettingsBase Constructor ()


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Initializes an instance of the ApplicationSettingsBase class to its default state.

Namespace:   System.Configuration
Assembly:  System (in System.dll)

protected ApplicationSettingsBase()

The default constructor was designed to work under the assumption that there is no component associated with the current settings wrapper class, which derives from ApplicationSettingsBase.

When an instance of a wrapper class is created, inherited code will automatically perform the following actions:

  1. Reflect over the class.

  2. For each property on the wrapper marked with either [UserScopedSettingAttribute] or [ApplicationScopedSettingAttribute], a corresponding SettingsProperty is created.

  3. Each SettingsProperty has some of its properties set based on other attributes that are optionally present on the wrapper's properties, such as the default value or the settings provider.

  4. All other attributes are simply put into an attribute bag, the Attributes property of the SettingsProperty class.

  5. All SettingsProperty objects are added to a SettingsPropertyCollection represented by the Properties property of the ApplicationSettingsBase class. This collection is then passed to the Initialize method.

As implied by step 3 mentioned previously, ApplicationSettingsBase natively works with several property attributes, specifically the following: SettingsProviderAttribute, DefaultSettingValueAttribute, and SettingsSerializeAsAttribute. All other settings attributes are simply passed through to the appropriate underlying provider.

.NET Framework
Available since 2.0
Return to top