private static void Initialize()
        {
            HttpRuntime.CheckAspNetHostingPermission(AspNetHostingPermissionLevel.Low, SR.Feature_not_supported_at_this_level);

            if (_initialized)
            {
                return;
            }

            lock (_initializationLock) {
                if (_initialized)
                {
                    return;
                }

                WebPartsSection         webPartsSection = RuntimeConfig.GetAppConfig().WebParts;
                WebPartsPersonalization personalization = webPartsSection.Personalization;

                Debug.Assert(_providers == null);
                _providers = new PersonalizationProviderCollection();

                ProvidersHelper.InstantiateProviders(personalization.Providers, _providers, typeof(PersonalizationProvider));
                _providers.SetReadOnly();
                _provider = _providers[personalization.DefaultProvider];
                if (_provider == null)
                {
                    throw new ConfigurationErrorsException(
                              SR.GetString(SR.Config_provider_must_exist, personalization.DefaultProvider),
                              personalization.ElementInformation.Properties["defaultProvider"].Source,
                              personalization.ElementInformation.Properties["defaultProvider"].LineNumber);
                }

                _initialized = true;
            }
        }
        private static void Initialize() {
            HttpRuntime.CheckAspNetHostingPermission(AspNetHostingPermissionLevel.Low, SR.Feature_not_supported_at_this_level);

            if (_initialized) {
                return;
            }

            lock (_initializationLock) {
                if (_initialized) {
                    return;
                }

                WebPartsSection webPartsSection = RuntimeConfig.GetAppConfig().WebParts;
                WebPartsPersonalization personalization = webPartsSection.Personalization;

                Debug.Assert(_providers == null);
                _providers = new PersonalizationProviderCollection();

                ProvidersHelper.InstantiateProviders(personalization.Providers, _providers, typeof(PersonalizationProvider));
                _providers.SetReadOnly();
                _provider = _providers[personalization.DefaultProvider];
                if (_provider == null) {
                    throw new ConfigurationErrorsException(
                        SR.GetString(SR.Config_provider_must_exist, personalization.DefaultProvider),
                        personalization.ElementInformation.Properties["defaultProvider"].Source,
                        personalization.ElementInformation.Properties["defaultProvider"].LineNumber);
                }

                _initialized = true;
            }
        }