public DockerSecretConfigurationProvider(FileConfigurationSource source, string?configKey = default)
     : base(source)
 {
     _configKey = Guard.Argument(configKey)
                  .ValidConfigKey()
                  .Value;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance with the specified source.
 /// </summary>
 /// <param name="source">The source settings.</param>
 public FileConfigurationProvider(FileConfigurationSource source)
 {
     if (source == null)
     {
         throw new ArgumentNullException(nameof(source));
     }
     Source = source;
 }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance with the specified source.
        /// </summary>
        /// <param name="source">The source settings.</param>
        public FileConfigurationProvider(FileConfigurationSource source)
        {
            Source = source ?? throw new ArgumentNullException(nameof(source));

            if (Source.ReloadOnChange && Source.FileProvider != null)
            {
                _changeTokenRegistration = ChangeToken.OnChange(
                    () => Source.FileProvider.Watch(Source.Path),
                    () =>
                {
                    Thread.Sleep(Source.ReloadDelay);
                    Load(reload: true);
                });
            }
        }
Exemplo n.º 4
0
        public FileConfigurationProvider(FileConfigurationSource source)
        {
            if (source == null)
            {
                throw new ArgumentNullException(nameof(source));
            }
            Source = source;

            if (Source.ReloadOnChange && Source.FileProvider != null)
            {
                ChangeToken.OnChange(
                    () => Source.FileProvider.Watch(Source.Path),
                    () => Load());
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Initializes a new instance with the specified source.
        /// </summary>
        /// <param name="source">The source settings.</param>
        public FileConfigurationProvider(FileConfigurationSource source)
        {
            ThrowHelper.ThrowIfNull(source);

            Source = source;

            if (Source.ReloadOnChange && Source.FileProvider != null)
            {
                _changeTokenRegistration = ChangeToken.OnChange(
                    () => Source.FileProvider.Watch(Source.Path !),
                    () =>
                {
                    Thread.Sleep(Source.ReloadDelay);
                    Load(reload: true);
                });
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// Initializes a new instance with the specified source.
        /// </summary>
        /// <param name="source">The source settings.</param>
        public FileConfigurationProvider(FileConfigurationSource source)
        {
            if (source == null)
            {
                throw new ArgumentNullException(nameof(source));
            }
            Source = source;

            if (Source.ReloadOnChange && Source.FileProvider != null)
            {
                ChangeToken.OnChange(
                    () => Source.FileProvider.Watch(Source.Path),//Bookmarks crucial code on detect configuration file changes
                    () => {
                    Thread.Sleep(Source.ReloadDelay);
                    Load(reload: true);
                });
            }
        }
Exemplo n.º 7
0
 public AppConfigConfigurationProvider(FileConfigurationSource source) : base(source)
 {
 }
 /// <summary>
 /// Initializes a new instance with the specified source.
 /// </summary>
 /// <param name="source">The source settings.</param>
 public FileConfigurationProvider(FileConfigurationSource source !!)
 {