Esempio n. 1
0
        /// <summary>
        /// The load providers.
        /// </summary>
        /// <exception cref="ProviderException">
        /// </exception>
        private static void LoadProviders()
        {
            if (_provider == null)
            {
                lock (Lock)
                {
                    var section = AppConfig.Instance.Storage;

                    _providers = new StorageProviderCollection();
                    ProvidersHelper.InstantiateProviders(section.Providers, _providers, typeof(StorageProvider));
                    _provider = _providers[section.DefaultProvider];

                    if (_provider == null)
                    {
                        throw new ProviderException("Unable to load default StorageProvider");
                    }
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// The load providers.
        /// </summary>
        /// <exception cref="ProviderException">
        /// </exception>
        private static void LoadProviders()
        {
            if (_provider == null)
            {
                lock (Lock)
                {
                    var section = AppConfig.Instance.Storage;

                    _providers = new StorageProviderCollection();
                    ProvidersHelper.InstantiateProviders(section.Providers, _providers, typeof (StorageProvider));
                    _provider = _providers[section.DefaultProvider];

                    if (_provider == null)
                    {
                        throw new ProviderException("Unable to load default StorageProvider");
                    }
                }
            }
        }