예제 #1
0
        private static void Initialize()
        {
            try
            {
                //Get the feature's configuration info
                CachingConfiguation qc =
                    (CachingConfiguation)ConfigurationManager.GetSection("CachingProvider");

                if (qc.DefaultProvider == null || qc.Providers == null || qc.Providers.Count < 1)
                    throw new ProviderException("You must specify a valid default provider.");

                //Instantiate the providers
                providerCollection = new CachingProviderCollection();
                ProvidersHelper.InstantiateProviders(qc.Providers, providerCollection, typeof(CachingProviderBase));
                providerCollection.SetReadOnly();
                defaultProvider = providerCollection[qc.DefaultProvider];
                if (defaultProvider == null)
                {
                    throw new ConfigurationErrorsException(
                        "You must specify a default provider for the feature.",
                        qc.ElementInformation.Properties["defaultProvider"].Source,
                        qc.ElementInformation.Properties["defaultProvider"].LineNumber);
                }

                //if (qc.ClearDuration > 0) ClearSeconds = qc.ClearDuration;

                //InitClear();

            }
            catch (Exception ex)
            {
                initializationException = ex;
                isInitialized = true;
                throw ex;
            }

            isInitialized = true; //error-free initialization
        }
예제 #2
0
 public void CopyTo(CachingProviderBase[] array, int index)
 {
     base.CopyTo(array, index);
 }