ContextInformation
namespace System.Configuration
{
public sealed class ContextInformation
{
private readonly BaseConfigurationRecord _configRecord;
private object _hostingContext;
private bool _hostingContextEvaluated;
public object HostingContext {
get {
if (!_hostingContextEvaluated) {
_hostingContext = _configRecord.ConfigContext;
_hostingContextEvaluated = true;
}
return _hostingContext;
}
}
public bool IsMachineLevel => _configRecord.IsMachineConfig;
internal ContextInformation(BaseConfigurationRecord configRecord)
{
_hostingContextEvaluated = false;
_hostingContext = null;
_configRecord = configRecord;
}
public object GetSection(string sectionName)
{
return _configRecord.GetSection(sectionName);
}
}
}