Configuration.EvaluationContext 屬性

定義

取得 Configuration 物件的 ContextInformation 物件。

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

屬性值

ContextInformation 物件的 Configuration 物件。

範例

下列程式代碼範例示範如何使用 EvaluationContext 屬性。

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())

備註

ContextInformation物件會根據對象的評估位置,提供物件回應所需的Configuration內容。

適用於

另請參閱