/// <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); }
public static IConfigConfiguration UseStorageNetBlobs(this IConfigConfiguration configuration, IBlobStorageProvider blobs) { IConfigStore store = new BlobConfigStore(blobs); configuration.AddStore(store); return(configuration); }
protected override void OnConfigure(IConfigConfiguration configuration) { configuration.AddStore(_store); if (_customParser != null) { configuration.AddParser(_customParser); } }
protected override void OnConfigure(IConfigConfiguration configuration) { configuration.UseIniFile("c:\\tmp\\integration-tests.ini"); configuration.UseEnvironmentVariables(); configuration.UseCommandLineArgs(new Dictionary <int, Option> { { 0, AzureStorageName } }); }
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(); }
protected override void OnConfigure(IConfigConfiguration configuration) { configuration.UseIniFile("c:\\tmp\\integration-tests.ini"); }
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); }
protected override void OnConfigure(IConfigConfiguration configuration) { configuration.UseIniFile("c:\\tmp\\LivyApi.ini"); configuration.UseEnvironmentVariables(); }
/// <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);
protected override void OnConfigure(IConfigConfiguration configuration) { configuration.UseJsonFile(string.Format(@"{0}\config.json", AppDomain.CurrentDomain.BaseDirectory)); }
protected override void OnConfigure(IConfigConfiguration configuration) { configuration.CacheTimeout = TimeSpan.FromMinutes(1); //configuration.UseAzureTable("storage_account_name", "storage_key", "table_name", "application_name"); }
/// <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"); }
protected override void OnConfigure(IConfigConfiguration configuration) { configuration.UseIniFile(Settings.GetPath("crypto.ini")); }
protected override void OnConfigure(IConfigConfiguration configuration) { configuration.UseCommandLineArgs(new Dictionary <int, Option> { { 0, Mode } }); }
protected override void OnConfigure(IConfigConfiguration configuration) { configuration.UseJsonFile(@"config/input/openbci.json"); }
/// <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); }
/// <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"); }
/// <summary> /// Standard app.config (web.config) configuration store. Read-only. /// </summary> public static IConfigConfiguration UseAppConfig(this IConfigConfiguration configuration) { configuration.AddStore(new AppConfigStore()); return(configuration); }
/// <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); }
protected override void OnConfigure(IConfigConfiguration configuration) { configuration.AddStore(_store); }
/// <summary> /// Uses system environment variables /// </summary> public static IConfigConfiguration UseEnvironmentVariables(this IConfigConfiguration configuration) { configuration.AddStore(new EnvironmentVariablesStore()); return(configuration); }
/// <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); }
protected override void OnConfigure(IConfigConfiguration configuration) { configuration.UseCommandLineArgs(); }
/// <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); }
public static IConfigConfiguration UseStorageNetTable(this IConfigConfiguration configuration, ITableStorage tables) { return(null); }
/// <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); }