private static void Initialize() { CloudStorageSection cloudStorageConfig = null; // don't initialize providers more than once if ( !_initialized ) { // get the configuration section for the feature cloudStorageConfig = (CloudStorageSection)ConfigurationManager.GetSection( "cloudStorage" ); if ( cloudStorageConfig == null ) throw new Exception( "CloudStorage is not configured for this application" ); _providers = new CloudStorageProviderCollection(); // use the ProvidersHelper class to call Initialize on each configured provider ProvidersHelper.InstantiateProviders( cloudStorageConfig.Providers, _providers, typeof( CloudStorageProvider ) ); // set a reference to the default provider _provider = (CloudStorageProvider)_providers[ cloudStorageConfig.DefaultProvider]; // set this feature as initialized _initialized = true; } }