編輯

共用方式為


Configuration.EvaluationContext Property

Definition

Gets the ContextInformation object for the Configuration object.

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

Property Value

The ContextInformation object for the Configuration object.

Examples

The following code example demonstrates how to use the EvaluationContext property.

ContextInformation evalContext =
    config.EvaluationContext as ContextInformation;
Console.WriteLine("Machine level: {0}",
    evalContext.IsMachineLevel.ToString());
Dim evalContext As ContextInformation = TryCast(config.EvaluationContext, ContextInformation)
Console.WriteLine("Machine level: {0}", evalContext.IsMachineLevel.ToString())

Remarks

A ContextInformation object provides the context necessary for a Configuration object to respond based upon where it is being evaluated.

Applies to

See also