private string GetRegion(StorageProviderCredentialSource StorageProviderRegionSource, string StorageProviderRegionKey) { string retVal = null; switch (StorageProviderRegionSource) { case StorageProviderCredentialSource.AppSetting: retVal = ConfigurationManager.AppSettings[StorageProviderRegionKey]; break; default: retVal = StorageProviderRegionKey; break; } return(retVal); }
public void Initialize(List <CodeTorch.Core.Setting> settings) { foreach (Setting setting in settings) { switch (setting.Name.ToLower()) { case "accesskeyidsource": storageProviderUserNameSource = (StorageProviderCredentialSource)Enum.Parse(typeof(StorageProviderCredentialSource), setting.Value); break; case "accesskeyid": storageProviderUserNameKey = setting.Value; break; case "secretkeysource": storageProviderPasswordSource = (StorageProviderCredentialSource)Enum.Parse(typeof(StorageProviderCredentialSource), setting.Value); break; case "secretkey": storageProviderPasswordKey = setting.Value; break; case "regionsource": storageProviderRegionSource = (StorageProviderCredentialSource)Enum.Parse(typeof(StorageProviderCredentialSource), setting.Value); break; case "region": storageProviderRegionKey = setting.Value; break; case "bucketsource": storageProviderContainerSource = (StorageProviderCredentialSource)Enum.Parse(typeof(StorageProviderCredentialSource), setting.Value); break; case "bucket": storageProviderContainerKey = setting.Value; break; } } }