ContextInformation Class

 

Encapsulates the context information that is associated with a ConfigurationElement object. This class cannot be inherited.

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

System::Object
  System.Configuration::ContextInformation

public ref class ContextInformation sealed 

NameDescription
System_CAPS_pubpropertyHostingContext

Gets the context of the environment where the configuration property is being evaluated.

System_CAPS_pubpropertyIsMachineLevel

Gets a value specifying whether the configuration property is being evaluated at the machine configuration level.

NameDescription
System_CAPS_pubmethodEquals(Object^)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetSection(String^)

Provides an object containing configuration-section information based on the specified section name.

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

The ContextInformation object provides environment details related to an element of the configuration. For instance, you can use the IsMachineLevel property to determine whether a ConfigurationElement was set in Machine.config, or you can determine which hierarchy a ConfigurationElement belongs to by using the HostingContext property.

The following code example demonstrates how to use the ContextInformation type.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0

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

Return to top
Show: