Export (0) Print
Expand All

SettingsContext Class

Provides contextual information that the provider can use when persisting settings.

System.Object
  System.Collections.Hashtable
    System.Configuration.SettingsContext

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

'Declaration
<SerializableAttribute> _
Public Class SettingsContext _
	Inherits Hashtable

The SettingsContext type exposes the following members.

  NameDescription
Public methodSettingsContextInitializes a new instance of the SettingsContext class.
Top

  NameDescription
Protected propertycomparer Obsolete. Gets or sets the IComparer to use for the Hashtable. (Inherited from Hashtable.)
Public propertyCountGets the number of key/value pairs contained in the Hashtable. (Inherited from Hashtable.)
Protected propertyEqualityComparerGets the IEqualityComparer to use for the Hashtable. (Inherited from Hashtable.)
Protected propertyhcp Obsolete. Gets or sets the object that can dispense hash codes. (Inherited from Hashtable.)
Public propertyIsFixedSizeGets a value indicating whether the Hashtable has a fixed size. (Inherited from Hashtable.)
Public propertyIsReadOnlyGets a value indicating whether the Hashtable is read-only. (Inherited from Hashtable.)
Public propertyIsSynchronizedGets a value indicating whether access to the Hashtable is synchronized (thread safe). (Inherited from Hashtable.)
Public propertyItemGets or sets the value associated with the specified key. (Inherited from Hashtable.)
Public propertyKeysGets an ICollection containing the keys in the Hashtable. (Inherited from Hashtable.)
Public propertySyncRootGets an object that can be used to synchronize access to the Hashtable. (Inherited from Hashtable.)
Public propertyValuesGets an ICollection containing the values in the Hashtable. (Inherited from Hashtable.)
Top

  NameDescription
Public methodAddAdds an element with the specified key and value into the Hashtable. (Inherited from Hashtable.)
Public methodClearRemoves all elements from the Hashtable. (Inherited from Hashtable.)
Public methodCloneCreates a shallow copy of the Hashtable. (Inherited from Hashtable.)
Public methodContainsDetermines whether the Hashtable contains a specific key. (Inherited from Hashtable.)
Public methodContainsKeyDetermines whether the Hashtable contains a specific key. (Inherited from Hashtable.)
Public methodContainsValueDetermines whether the Hashtable contains a specific value. (Inherited from Hashtable.)
Public methodCopyToCopies the Hashtable elements to a one-dimensional Array instance at the specified index. (Inherited from Hashtable.)
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetEnumeratorReturns an IDictionaryEnumerator that iterates through the Hashtable. (Inherited from Hashtable.)
Protected methodGetHashReturns the hash code for the specified key. (Inherited from Hashtable.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetObjectDataImplements the ISerializable interface and returns the data needed to serialize the Hashtable. (Inherited from Hashtable.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodKeyEqualsCompares a specific Object with a specific key in the Hashtable. (Inherited from Hashtable.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodOnDeserializationImplements the ISerializable interface and raises the deserialization event when the deserialization is complete. (Inherited from Hashtable.)
Public methodRemoveRemoves the element with the specified key from the Hashtable. (Inherited from Hashtable.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Explicit interface implemetationPrivate methodIEnumerable.GetEnumeratorReturns an enumerator that iterates through a collection. (Inherited from Hashtable.)
Top

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.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2014 Microsoft