ConfigurationElement.EvaluationContext Property

Definition

获取 ContextInformation 对象的 ConfigurationElement 对象。Gets the ContextInformation object for the ConfigurationElement object.

protected:
 property System::Configuration::ContextInformation ^ EvaluationContext { System::Configuration::ContextInformation ^ get(); };
protected System.Configuration.ContextInformation EvaluationContext { get; }
member this.EvaluationContext : System.Configuration.ContextInformation
Protected ReadOnly Property EvaluationContext As ContextInformation

Property Value

ContextInformation

ContextInformationConfigurationElementThe ContextInformation for the ConfigurationElement.

Exceptions

当前元素未关联上下文。The current element is not associated with a context.

Remarks

ContextInformation 对象提供 ConfigurationElement 对象根据其计算位置做出决策所需的上下文。A ContextInformation object provides the context necessary for a ConfigurationElement object to make decisions based upon where it is being evaluated.

ContextInformation 对象提供与配置的元素相关的环境详细信息。The ContextInformation object provides environment details related to an element of the configuration. 例如,你可以使用 IsMachineLevel 属性来确定是否已在 Machine.config 中设置 ConfigurationElement,或者可以使用 HostingContext 属性确定 ConfigurationElement 元素所属的层次结构。For example, you can use the IsMachineLevel property to determine whether a ConfigurationElement was set in Machine.config, or you can determine which hierarchy a ConfigurationElement element belongs to by using the HostingContext property.

Applies to

See also