Пример #1
0
        private static OutputCacheProvider GetFragmentProvider(String providerName)
        {
            // if providerName is null, use default provider.  If default provider is null, we'll use internal cache.
            // if providerName is not null, get it from the provider collection.
            OutputCacheProvider provider = null;

            if (providerName == null)
            {
                provider = s_defaultProvider;
            }
            else
            {
                provider = s_providers[providerName];
                if (provider == null)
                {
                    Debug.Assert(false, "Unexpected, " + providerName + " should be a member of the collection.");
                    throw new ProviderException(SR.GetString(SR.Provider_Not_Found, providerName));
                }
            }
#if DBG
            string msg = (provider != null) ? provider.GetType().Name : "null";
            Debug.Trace("OutputCache", "GetFragmentProvider(" + providerName + ") --> " + msg);
#endif
            return(provider);
        }