/// <summary>
        /// Retrieves the cache configuration section from the current application configuration. 
        /// </summary>
        /// <returns>The cache configuration section from the current application configuration.</returns>
        public static ImageCacheSection GetConfiguration()
        {
            ImageCacheSection imageCacheSection = ConfigurationManager.GetSection("imageProcessor/caching") as ImageCacheSection;

            if (imageCacheSection != null)
            {
                return imageCacheSection;
            }

            string section = ResourceHelpers.ResourceAsString("ImageProcessor.Web.Configuration.Resources.cache.config.transform");
            XmlReader reader = new XmlTextReader(new StringReader(section));
            imageCacheSection = new ImageCacheSection();
            imageCacheSection.DeserializeSection(reader);

            return imageCacheSection;
        }
Beispiel #2
0
        /// <summary>
        /// Retrieves the cache configuration section from the current application configuration.
        /// </summary>
        /// <returns>The cache configuration section from the current application configuration.</returns>
        public static ImageCacheSection GetConfiguration()
        {
            ImageCacheSection imageCacheSection = ConfigurationManager.GetSection("imageProcessor/caching") as ImageCacheSection;

            if (imageCacheSection != null)
            {
                return(imageCacheSection);
            }

            string    section = ResourceHelpers.ResourceAsString("ImageProcessor.Web.Configuration.Resources.cache.config.transform");
            XmlReader reader  = new XmlTextReader(new StringReader(section));

            imageCacheSection = new ImageCacheSection();
            imageCacheSection.DeserializeSection(reader);

            return(imageCacheSection);
        }
 /// <summary>
 /// Retrieves the caching configuration section from the current application configuration.
 /// </summary>
 /// <returns>The caching configuration section from the current application configuration. </returns>
 private static ImageCacheSection GetImageCacheSection() => imageCacheSection ?? (imageCacheSection = ImageCacheSection.GetConfiguration());
 /// <summary>
 /// Retrieves the caching configuration section from the current application configuration. 
 /// </summary>
 /// <returns>The caching configuration section from the current application configuration. </returns>
 private static ImageCacheSection GetImageCacheSection()
 {
     return imageCacheSection ?? (imageCacheSection = ImageCacheSection.GetConfiguration());
 }
Beispiel #5
0
 /// <summary>
 /// Retrieves the caching configuration section from the current application configuration.
 /// </summary>
 /// <returns>The caching configuration section from the current application configuration. </returns>
 private static ImageCacheSection GetImageCacheSection()
 {
     return(imageCacheSection ?? (imageCacheSection = ImageCacheSection.GetConfiguration()));
 }