System 2.0.0.0 4.0.0.0 System.Configuration.Provider.ProviderBase

A settings provider defines the mechanism for storing configuration data used in the application settings architecture. The .NET Framework contains a single default settings provider, , which stores configuration data to the local file system. However, you can create alternate storage mechanisms by deriving from the abstract class. The provider that a wrapper class uses is determined by decorating the wrapper class with the . If this attribute is not provided, the default, , is used.

When you create a custom settings provider, at minimum, you must provide implementations for the three methods of this class: , and .

For client applications, you can add more standardized functionality to a custom provider by also implementing the interface. This interface mirrors methods found in the class, which mainly enables versioning support.

Typically, you should design settings providers to be single-instanced to avoid storage resource contention. Providers should also be thread-safe because they can be called simultaneously from multiple wrapper instances in a single application domain or from multiple applications in different domains.

At minimum, a settings provider must recognize three attributes—, , and . For a full listing of attributes that can be applied to application settings, see Application Settings Attributes. A custom setting provider should resolve attributes applied to settings properties in the following manner:

If the provider can fulfill the request implied by the attribute, obviously it should do so.

If the provider cannot fulfill the request, it should ignore it silently.

If two or more properties conflict; for example, a property being decorated with both and ; the provider should throw a .

Acts as a base class for deriving custom settings providers in the application settings architecture.

- Constructor
  2.0.0.0
  4.0.0.0

  This is this default protected constructor for this abstract class. Derived custom settings providers are not required to provide an explicit constructor because the method typically performs all initialization.

  Client code typically does not directly instantiate a settings provider; instead, you use the following procedure to find a settings provider for a particular settings property:

  Call the method on the current or to return a reference to the current .

  Call the method of the retrieved in the first step to return the settings provider.

  Initializes an instance of the class.

- Property
  2.0.0.0
  4.0.0.0
  System.String To be added.

  The and properties help to disambiguate similarly named setting properties in different applications.

  Gets or sets the name of the currently running application.

- Method
  2.0.0.0
  4.0.0.0
  System.Configuration.SettingsPropertyValueCollection `` ``

  The method must be implemented to handle special settings, those marked with , as well as reconcile application and user settings.

  Returns the collection of settings property values for the specified application instance and settings property group.

  A containing the values for the specified settings property group.

  A describing the current application use. A containing the settings property group whose values are to be retrieved.
- Method
  2.0.0.0
  4.0.0.0
  System.Void `` ``

  contains the method, which is called to persist the values of all of its settings properties. This method enumerates through all the settings providers associated with its settings properties, and calls the method for each to perform the actual serialization operation.

  The method should be implemented with security in mind:

  Only fully trusted code should be allowed to update application settings. Partially trusted code should be allowed to update only user application settings. Untrusted code is not typically allowed to update application settings.

  Usage quotas should be considered to guard against resource attacks by partially trusted applications.

  Sets the values of the specified group of property settings.

  A describing the current application usage. A representing the group of property settings to set.