本文整理汇总了C#中IConfigurationProvider.Load方法的典型用法代码示例。如果您正苦于以下问题:C# IConfigurationProvider.Load方法的具体用法?C# IConfigurationProvider.Load怎么用?C# IConfigurationProvider.Load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IConfigurationProvider
的用法示例。
在下文中一共展示了IConfigurationProvider.Load方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Add
/// <summary>
/// Adds a new provider to obtain configuration values from.
/// This method is intended only for test scenarios.
/// </summary>
/// <param name="provider">The configuration provider to add.</param>
/// <param name="load">If true, the configuration provider's <see cref="IConfigurationProvider.Load"/> method will
/// be called.</param>
/// <returns>The same <see cref="IConfigurationBuilder"/>.</returns>
public IConfigurationBuilder Add(IConfigurationProvider provider, bool load)
{
if (load)
{
provider.Load();
}
_providers.Add(provider);
return this;
}
示例2: Add
/// <summary>
///
/// </summary>
/// <param name="configurationProvider"></param>
/// <param name="setAll"></param>
public void Add(IConfigurationProvider configurationProvider, bool setAll = false)
{
if (setAll)
{
foreach (var configurable in m_configurables)
{
configurationProvider.Set(configurable.Key, configurable.Value.GetValue(null));
}
}
configurationProvider.Load();
m_providers.Add(configurationProvider);
if (configurationProvider is ICommitableProvider)
{
m_commitableProviders.Add(configurationProvider as ICommitableProvider);
}
}
示例3: MediaContentConfigurationViewModel
public MediaContentConfigurationViewModel(IConfigurationProvider configurationProvider)
{
_configurationProvider = configurationProvider;
//_configurationProvider.ConfigurationSettingsChanged += _configurationProvider_ConfigurationSettingsChanged;
var cs = _configurationProvider.Load();
ConfigureContent(cs);
}
示例4: Add
/// <summary>
/// Adds a new configuration provider.
/// </summary>
/// <param name="provider">The configuration provider to add.</param>
/// <returns>The same <see cref="IConfigurationBuilder"/>.</returns>
public IConfigurationBuilder Add(IConfigurationProvider provider)
{
provider.Load();
this.providers.Add(provider);
return this;
}
示例5: MediaContentConfigurationViewModel
public MediaContentConfigurationViewModel(IConfigurationProvider configurationProvider)
{
_configurationProvider = configurationProvider;
var cs = _configurationProvider.Load();
ConfigureContent(cs);
}