ApplicationSettingsBase Constructor (IComponent, String)


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 using the supplied owner component and settings key.

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

protected ApplicationSettingsBase(
	IComponent owner,
	string settingsKey


Type: System.ComponentModel.IComponent

The component that will act as the owner of the application settings object.

Type: System.String

A String that uniquely identifies separate instances of the wrapper class.

Exception Condition

owner is null.

The IComponent object specified by the owner parameter acts as the owner of the current instance of this applications settings class. During the initialization of the settings wrapper class derived from ApplicationSettingsBase, the owner's site is queried for a ISettingsProviderService. If one exists, it is used in preference to native settings provider for all the properties of the wrapper class, as specified by the SettingsProviderAttribute.

This constructor initializes the SettingsKey property to the value of the settingsKey parameter. This property is useful in disambiguating different instances of the wrapper class in the same application domain.

For information about how reflection is used during the instantiation of a wrapper class, see the default ApplicationSettingsBase() constructor.

.NET Framework
Available since 2.0
Return to top