/// <summary>
        /// Use Azure Key Vault
        /// </summary>
        /// <param name="configuration"></param>
        /// <param name="vaultUri"></param>
        /// <param name="azureAadClientId"></param>
        /// <param name="azureAadClientSecret"></param>
        /// <returns></returns>
        public static IConfigConfiguration UseAzureKeyVault(this IConfigConfiguration configuration,
                                                            Uri vaultUri, string azureAadClientId, string azureAadClientSecret)
        {
            configuration.AddStore(new AzureKeyVaultConfigStore(vaultUri, azureAadClientId, azureAadClientSecret));

            return(configuration);
        }
Esempio n. 2
0
        public static IConfigConfiguration UseStorageNetBlobs(this IConfigConfiguration configuration, IBlobStorageProvider blobs)
        {
            IConfigStore store = new BlobConfigStore(blobs);

            configuration.AddStore(store);

            return(configuration);
        }
Esempio n. 3
0
            protected override void OnConfigure(IConfigConfiguration configuration)
            {
                configuration.AddStore(_store);

                if (_customParser != null)
                {
                    configuration.AddParser(_customParser);
                }
            }
Esempio n. 4
0
        protected override void OnConfigure(IConfigConfiguration configuration)
        {
            configuration.UseIniFile("c:\\tmp\\integration-tests.ini");
            configuration.UseEnvironmentVariables();

            configuration.UseCommandLineArgs(new Dictionary <int, Option>
            {
                { 0, AzureStorageName }
            });
        }
Esempio n. 5
0
 protected override void OnConfigure(IConfigConfiguration configuration)
 {
     configuration.CacheTimeout = TimeSpan.FromMinutes(1);
     if (_reverse)
     {
         configuration.UseJsonFile(@".\low.json");
         configuration.UseJsonFile(@".\medium.json");
         configuration.UseJsonFile(@".\high.json");
     }
     else
     {
         configuration.UseJsonFile(@".\high.json");
         configuration.UseJsonFile(@".\medium.json");
         configuration.UseJsonFile(@".\low.json");
     }
 }
        protected override void OnConfigure(IConfigConfiguration configuration)
        {
            configuration.CacheTimeout = TimeSpan.Zero;

            // legacy configuration
            configuration.UseAppConfig();

            // general settings
            var exeConfigPath = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), JsonConfigFileName);

            configuration.UseJsonFile(exeConfigPath);

            // personalized settings
            var homeConfigPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), JsonConfigFileName);

            configuration.UseJsonFile(homeConfigPath);

            // command line
            // TODO: replace current solution with Config.Net
            // configuration.UseCommandLineArgs();
        }
Esempio n. 7
0
 protected override void OnConfigure(IConfigConfiguration configuration)
 {
     configuration.UseIniFile("c:\\tmp\\integration-tests.ini");
 }
Esempio n. 8
0
 protected override void OnConfigure(IConfigConfiguration configuration)
 {
     configuration.AddStore(_store);
     configuration.CacheTimeout = TimeSpan.Zero;
 }
 /// <summary>
 /// Uses JSON file as a configuration storage.
 /// </summary>
 /// <param name="configuration">Configuration object.</param>
 /// <param name="jsonFilePath">Full path to json storage file.</param>
 /// <returns>Changed configuration.</returns>
 /// <remarks>Storage file does not have to exist, however it will be created as soon as first write performed.</remarks>
 public static IConfigConfiguration UseJsonFile(this IConfigConfiguration configuration, string jsonFilePath)
 {
     configuration.AddStore(new JsonFileConfigStore(jsonFilePath));
     return(configuration);
 }
Esempio n. 10
0
 protected override void OnConfigure(IConfigConfiguration configuration)
 {
     configuration.UseIniFile("c:\\tmp\\LivyApi.ini");
     configuration.UseEnvironmentVariables();
 }
Esempio n. 11
0
 /// <summary>
 /// This method is called internally before containers is ready for use. You can specify
 /// configuration stores or any other options here.
 /// </summary>
 /// <param name="configuration"></param>
 protected abstract void OnConfigure(IConfigConfiguration configuration);
Esempio n. 12
0
 protected override void OnConfigure(IConfigConfiguration configuration)
 {
     configuration.UseJsonFile(string.Format(@"{0}\config.json", AppDomain.CurrentDomain.BaseDirectory));
 }
Esempio n. 13
0
        protected override void OnConfigure(IConfigConfiguration configuration)
        {
            configuration.CacheTimeout = TimeSpan.FromMinutes(1);

             //configuration.UseAzureTable("storage_account_name", "storage_key", "table_name", "application_name");
        }
Esempio n. 14
0
 protected override void OnConfigure(IConfigConfiguration configuration)
 {
     configuration.AddStore(_store);
     configuration.CacheTimeout = TimeSpan.Zero;
 }
Esempio n. 15
0
 /// <summary>
 /// Accepts configuration from the command line arguments. This is not intended to replace a command line parsing framework but rather
 /// complement it in a configuration like way.
 /// </summary>
 /// <param name="configuration">Configuration object</param>
 /// <param name="args">Parameters usually passed to the Main method. This argument is optional and when set to null will get process
 /// command line parameters automatically.</param>
 /// <returns>Chained configuration</returns>
 public static IConfigConfiguration UseCommandLineArgs(this IConfigConfiguration configuration, string[] args)
 {
     configuration.AddStore(new CommandLineConfigStore(args));
     return(configuration);
 }
 protected override void OnConfigure(IConfigConfiguration configuration)
 {
     configuration.UseJsonFile(@"config/processing/emoeeg2ch.json");
 }
Esempio n. 17
0
 protected override void OnConfigure(IConfigConfiguration configuration)
 {
     configuration.UseIniFile(Settings.GetPath("crypto.ini"));
 }
Esempio n. 18
0
 protected override void OnConfigure(IConfigConfiguration configuration)
 {
     configuration.UseCommandLineArgs(new Dictionary <int, Option> {
         { 0, Mode }
     });
 }
Esempio n. 19
0
 protected override void OnConfigure(IConfigConfiguration configuration)
 {
     configuration.UseJsonFile(@"config/input/openbci.json");
 }
Esempio n. 20
0
 /// <summary>
 /// Accepts configuration from the command line arguments. This is not intended to replace a command line parsing framework but rather
 /// complement it in a configuration like way. Uses current process' command line parameters automatically
 /// </summary>
 /// <param name="configuration">Configuration object</param>
 /// <returns>Changed configuration</returns>
 public static IConfigConfiguration UseCommandLineArgs(this IConfigConfiguration configuration)
 {
     configuration.AddStore(new CommandLineConfigStore(null));
     return(configuration);
 }
Esempio n. 21
0
 /// <summary>
 /// Use azure tables
 /// </summary>
 public static IConfigConfiguration UseAzureTable(this IConfigConfiguration configuration,
                                                  string accountName, string storageKey, string tableName, string appName)
 {
     configuration.AddStore(new AzureTableConfigStore(accountName, storageKey, tableName, appName));
     return(configuration);
 }
 protected override void OnConfigure(IConfigConfiguration configuration)
 {
     configuration.UseJsonFile(@"config.json");
 }
Esempio n. 23
0
 /// <summary>
 /// Standard app.config (web.config) configuration store. Read-only.
 /// </summary>
 public static IConfigConfiguration UseAppConfig(this IConfigConfiguration configuration)
 {
     configuration.AddStore(new AppConfigStore());
     return(configuration);
 }
Esempio n. 24
0
 protected override void OnConfigure(IConfigConfiguration configuration)
 {
    configuration.UseIniFile("c:\\tmp\\integration-tests.ini");
 }
Esempio n. 25
0
 /// <summary>
 /// Reads configuration from the .dll.config or .exe.config file.
 /// </summary>
 /// <param name="configuration"></param>
 /// <param name="assembly">Reference to the assembly to look for</param>
 /// <returns></returns>
 public static IConfigConfiguration UseAssemblyConfig(this IConfigConfiguration configuration, Assembly assembly)
 {
     configuration.AddStore(new AssemblyConfigStore(assembly));
     return(configuration);
 }
Esempio n. 26
0
 protected override void OnConfigure(IConfigConfiguration configuration)
 {
     configuration.AddStore(_store);
 }
Esempio n. 27
0
 /// <summary>
 /// Uses system environment variables
 /// </summary>
 public static IConfigConfiguration UseEnvironmentVariables(this IConfigConfiguration configuration)
 {
     configuration.AddStore(new EnvironmentVariablesStore());
     return(configuration);
 }
Esempio n. 28
0
        protected override void OnConfigure(IConfigConfiguration configuration)
        {
            configuration.CacheTimeout = TimeSpan.FromMinutes(1);

            //configuration.UseAzureTable("storage_account_name", "storage_key", "table_name", "application_name");
        }
Esempio n. 29
0
 /// <summary>
 /// Simple INI storage.
 /// </summary>
 /// <param name="configuration"></param>
 /// <param name="iniFilePath">File does not have to exist, however it will be created as soon as you try to write to it.</param>
 /// <returns></returns>
 public static IConfigConfiguration UseIniFile(this IConfigConfiguration configuration, string iniFilePath)
 {
     configuration.AddStore(new IniFileConfigStore(iniFilePath));
     return(configuration);
 }
Esempio n. 30
0
 protected override void OnConfigure(IConfigConfiguration configuration)
 {
     configuration.UseCommandLineArgs();
 }
Esempio n. 31
0
 /// <summary>
 /// Use in-memory configuration
 /// </summary>
 /// <param name="configuration"></param>
 /// <returns></returns>
 public static IConfigConfiguration UseInMemoryConfig(this IConfigConfiguration configuration)
 {
     configuration.AddStore(new InMemoryConfigStore());
     return(configuration);
 }
Esempio n. 32
0
 public static IConfigConfiguration UseStorageNetTable(this IConfigConfiguration configuration, ITableStorage tables)
 {
     return(null);
 }
Esempio n. 33
0
 /// <summary>
 /// Accepts configuration from the command line arguments. This is not intended to replace a command line parsing framework but rather
 /// complement it in a configuration like way. Uses current process' command line parameters automatically
 /// </summary>
 /// <param name="configuration">Configuration object</param>
 /// <param name="positionToOption">When parameters are not named you can specify this dictionary to map parameter position to option value.</param>
 /// <returns>Changed configuration</returns>
 public static IConfigConfiguration UseCommandLineArgs(this IConfigConfiguration configuration, Dictionary <int, Option> positionToOption = null)
 {
     configuration.AddStore(new CommandLineConfigStore(null, positionToOption));
     return(configuration);
 }