コード例 #1
0
        public static IConfigurationBuilder AddJsonFileEx(this IConfigurationBuilder builder, IFileProvider provider, string path, bool optional, bool reloadOnChange)
        {
            Check.NotNull(builder, "builder");
            Check.CheckCondition(() => string.IsNullOrEmpty(path), "path");
            if (provider == null && Path.IsPathRooted(path))
            {
                provider = new PhysicalFileProvider(System.IO.Directory.GetCurrentDirectory());
                path     = Path.GetFileName(path);
            }
            var source = new Hummingbird.Extensions.Configuration.Json.JsonConfigurationSource
            {
                FileProvider   = provider,
                Path           = path,
                Optional       = optional,
                ReloadOnChange = reloadOnChange
            };

            builder.Add(source);
            return(builder);
        }
コード例 #2
0
 public JsonConfigurationProvider(
     JsonConfigurationSource source) : base(source)
 {
 }