System 2.0.0.0 4.0.0.0 System.Configuration.SettingsProvider System.Configuration.IApplicationSettingsProvider

Setting providers define a mechanism for storing configuration data used in the application settings architecture. The dnprdnshort contains a single default settings provider, , which stores configuration data to the local file system. An application settings property or group of properties are associated to a specific settings provider through the use of the .

Typically, the client program does not explicitly access this class; rather, the application settings architecture automatically invokes the appropriate settings provider when its services are required. For example, many of the members of delegate their work to the associated settings provider.

persists settings to configuration files that have the extension .config. The contents of configuration files are structured as XML documents. Depending on whether the setting is scoped at either the application-level or user-level, the configuration data is stored as elements within an <applicationSettings> or a <userSettings> section group, respectively. Each of these section groups is represented by a corresponding or , respectively. Each section object is owned and administered by a configuration section handler, which is an object of type .

Application-scoped settings and the default user-scoped settings are stored in a file named application.exe.config, which is created in the same directory as the executable file. Application configuration settings are read-only. Specific user data is stored in a file named user.config, stored under the user's home directory. If roaming profiles are enabled, two versions of the user configuration file could exist. In such a case, the entries in the roaming version take precedence over duplicated entries in the local user configuration file.

For more information about application settings, see Application Settings for Windows Forms.

Provides persistence for application settings classes.

- Constructor
  2.0.0.0
  4.0.0.0

  The default constructor sets the property to .

  Initializes a new 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.MonoTODO
  System.Configuration.SettingsPropertyValue `` ``

  The method is often used in conjunction with the method when migrating application settings during the installation of a new version of an application. For more information, see the method.

  Returns the value of the named settings property for the previous version of the same application.

  A representing the application setting if found; otherwise, null.

  A that describes where the application settings property is used. The whose value is to be returned.
- Method
  2.0.0.0
  4.0.0.0
  System.MonoTODO
  System.Configuration.SettingsPropertyValueCollection `` ``

  The method also manages the special application settings type . Connection strings are stored in a special section of the configuration file delimited by the element <connectionstrings>.

  does not use encryption to persist any settings. Therefore, do not store plain text passwords or other sensitive information using this provider without taking additional precautions, such as separately encrypting the information within the configuration file. For more information, see Encrypting Configuration Information using Protected Configuration.

  Returns the collection of setting 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 usage. A containing the settings property group whose values are to be retrieved.
- Method
  2.0.0.0
  4.0.0.0
  System.Void `` `` To be added. To be added. The name of the provider. The values for initialization.
- Method
  2.0.0.0
  4.0.0.0
  System.MonoTODO
  System.Void ``

  The method restores the stored values of the specified application settings group. The action of depends on the scope of the application settings property:

  Application-scoped settings are not affected.

  User-scoped settings are reset to the default values that are stored as read-only entries in the application configuration file, application.exe.config. If roaming profiles are being used, any application settings values in the roaming profile take precedence over duplicates found in the local profile.

  Notice that if roaming profiles are used, there can be two user.config files, one for the local settings and one for the roaming profile.

  Resets all application settings properties associated with the specified application to their default values.

  A describing the current application usage.
- Method
  2.0.0.0
  4.0.0.0
  System.MonoTODO
  System.Void `` ``

  A settings wrapper class, derived from , 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.

  individually serializes each user-scoped application settings property to its corresponding application setting in the appropriate user.config configuration file.

  By default, the method uses the following logical sequence to determine the serialization scheme, depending on type of the settings property:

  If the type has an associated with a method implementation, this conversion is used.

  XML serialization is used.

  However, you can specify a preferred serialization mechanism by using the . does not support binary serialization in vsprvslong.

  If a user-scoped settings property is set back to its default value explicitly, then the local file settings provider will remove the entry for the associated setting from the user configuration file. The next read access for this property will simply use the default value.

  does not use encryption to persist any settings. Therefore, do not store plain text passwords or other sensitive information using this provider without taking additional precautions, such as separately encrypting the information within the configuration file. For more information, see Encrypting Configuration Information using Protected Configuration.

  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.
- Method
  2.0.0.0
  4.0.0.0
  System.MonoTODO
  System.Void `` ``

  migrates the local and roaming settings in separate operations.

  The method is suppressed for every application setting that has the applied to it, or to the entire settings wrapper class, derived from .

  This way this method is called depends on the type of application that is being upgraded:

  Each version of a ndptecclick application is stored in its own isolated installation directory. After a new version of a ndptecclick application is installed, and when the new version is first run, internal logic will automatically call to migrate all common application settings to the new version. For more information, see ClickOnce and Application Settings.

  Standard Windows Forms and console applications must manually call , because there is not a general, automatic way to determine when such an application is first run. The two common ways to do this are either from the installation program or using from the application itself, using a persisted property, often named something like IsFirstRun.

  Note that for the newer version to migrate application settings, it must be able to also load and read the older version of the application settings. Therefore, it must contain wrapper classes compatible with both the new and previous versions of the application.

  Attempts to migrate previous user-scoped settings from a previous version of the same application.

  A describing the current application usage. A containing the settings property group whose values are to be retrieved.