示例#1
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/cache") as ImageCacheSection;

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

            return(new ImageCacheSection());
        }
        /// <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/cache") as ImageCacheSection;

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

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

            return imageCacheSection;
        }
示例#3
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/cache") as ImageCacheSection;

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

            string    section = ResourceHelpers.ResourceAsString("ImageProcessor.Web.Config.Resources.cache.config");
            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()
 {
     return 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()));
 }