SettingsContext Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides contextual information that the provider can use when persisting settings.
public ref class SettingsContext : System::Collections::Hashtable
public class SettingsContext : System.Collections.Hashtable
type SettingsContext = class
inherit Hashtable
Public Class SettingsContext
Inherits Hashtable
- Inheritance
Remarks
The SettingsContext class is the base class used by applications to provide contextual information to the settings provider. Although the class is not abstract, an application can choose to create a specialized class that inherits from SettingsContext class and provides additional information to specific types of providers. The provider can then examine contextual settings when writing properties.
The primary purpose of the SettingsContext class is to provide features that use the SettingsBase class and related infrastructure. The SettingsContext class provides additional feature-specific contextual information about the property data being stored by the SettingsBase instance. Therefore, it is very simple to store additional information in a SettingsContext class without deriving from it (or from other Settings* classes) in order to support additional feature-specific context information.
For example, ASP.NET uses the SettingsContext class to pass along the username associated with the data managed by a SettingsBase instance, as well as a property indicating whether the user is considered authenticated. In this way, ASP.NET uses the SettingsContext class to identify authenticated versus anonymous Profile data.
Constructors
| Name | Description |
|---|---|
| SettingsContext() |
Initializes a new instance of the SettingsContext class. |
| SettingsContext(SerializationInfo, StreamingContext) |
Constructor for deserializing a SettingsContext instance from state file (binary serialization). |