public static IConfigurationBuilder AddQuartzFile(this IConfigurationBuilder builder, IFileProvider provider, string path, bool optional, bool reloadOnChange)
        {
            Check.NotNull(builder, "builder");
            Check.CheckCondition(() => string.IsNullOrEmpty(path), "path");
            path = CPlatform.Utilities.EnvironmentHelper.GetEnvironmentVariable(path);
            if (provider == null && Path.IsPathRooted(path))
            {
                provider = new PhysicalFileProvider(Path.GetDirectoryName(path));
                path     = Path.GetFileName(path);
            }
            var source = new QuartzConfigurationSource
            {
                FileProvider   = provider,
                Path           = path,
                Optional       = optional,
                ReloadOnChange = reloadOnChange
            };

            builder.Add(source);
            AppConfig.Path          = path;
            AppConfig.Configuration = builder.Build();
            return(builder);
        }
Beispiel #2
0
 public QuartzConfigurationProvider(QuartzConfigurationSource source) : base(source)
 {
 }