-
Notifications
You must be signed in to change notification settings - Fork 105
/
Copy pathChainedConfigurationSource.cs
32 lines (28 loc) · 1.25 KB
/
ChainedConfigurationSource.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.using System;
using Microsoft.Extensions.Configuration;
namespace OmniSharp.Extensions.DebugAdapter.Client.Configuration
{
/// <summary>
/// Represents a chained <see cref="IConfiguration"/> as an <see cref="IConfigurationSource"/>.
/// </summary>
internal class ChainedConfigurationSource : IConfigurationSource
{
/// <summary>
/// The chained configuration.
/// </summary>
public IConfiguration Configuration { get; set; } = null!;
/// <summary>
/// Whether the chained configuration should be disposed when the
/// configuration provider gets disposed.
/// </summary>
public bool ShouldDisposeConfiguration { get; set; }
/// <summary>
/// Builds the <see cref="ChainedConfigurationProvider"/> for this source.
/// </summary>
/// <param name="builder">The <see cref="IConfigurationBuilder"/>.</param>
/// <returns>A <see cref="ChainedConfigurationProvider"/></returns>
public IConfigurationProvider Build(IConfigurationBuilder builder)
=> new ChainedConfigurationProvider(this);
}
}