Represents an image security section within a configuration file.
Inheritance: System.Configuration.ConfigurationSection
        /// <summary>
        /// Retrieves the security configuration section from the current application configuration. 
        /// </summary>
        /// <returns>The cache configuration section from the current application configuration.</returns>
        public static ImageSecuritySection GetConfiguration()
        {
            ImageSecuritySection imageSecuritySection = ConfigurationManager.GetSection("imageProcessor/security") as ImageSecuritySection;

            if (imageSecuritySection != null)
            {
                imageSecuritySection.AutoLoadServices = false;
                return imageSecuritySection;
            }

            string section = ResourceHelpers.ResourceAsString("ImageProcessor.Web.Configuration.Resources.security.config.transform");
            XmlReader reader = new XmlTextReader(new StringReader(section));
            imageSecuritySection = new ImageSecuritySection();
            imageSecuritySection.DeserializeSection(reader);
            imageSecuritySection.AutoLoadServices = true;
            return imageSecuritySection;
        }
Beispiel #2
0
        /// <summary>
        /// Retrieves the security configuration section from the current application configuration.
        /// </summary>
        /// <returns>The cache configuration section from the current application configuration.</returns>
        public static ImageSecuritySection GetConfiguration()
        {
            ImageSecuritySection imageSecuritySection = ConfigurationManager.GetSection("imageProcessor/security") as ImageSecuritySection;

            if (imageSecuritySection != null)
            {
                imageSecuritySection.AutoLoadServices = false;
                return(imageSecuritySection);
            }

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

            imageSecuritySection = new ImageSecuritySection();
            imageSecuritySection.DeserializeSection(reader);
            imageSecuritySection.AutoLoadServices = true;
            return(imageSecuritySection);
        }
 /// <summary>
 /// Retrieves the security configuration section from the current application configuration.
 /// </summary>
 /// <returns>The security configuration section from the current application configuration. </returns>
 internal ImageSecuritySection GetImageSecuritySection() => imageSecuritySection ?? (imageSecuritySection = ImageSecuritySection.GetConfiguration());
 /// <summary>
 /// Retrieves the security configuration section from the current application configuration. 
 /// </summary>
 /// <returns>The security configuration section from the current application configuration. </returns>
 internal ImageSecuritySection GetImageSecuritySection()
 {
     return imageSecuritySection ?? (imageSecuritySection = ImageSecuritySection.GetConfiguration());
 }
Beispiel #5
0
 /// <summary>
 /// Retrieves the security configuration section from the current application configuration.
 /// </summary>
 /// <returns>The security configuration section from the current application configuration. </returns>
 internal ImageSecuritySection GetImageSecuritySection()
 {
     return(imageSecuritySection ?? (imageSecuritySection = ImageSecuritySection.GetConfiguration()));
 }
 /// <summary>
 /// Retrieves the security configuration section from the current application configuration.
 /// </summary>
 /// <returns>The security configuration section from the current application configuration. </returns>
 private static ImageSecuritySection GetImageSecuritySection()
 {
     return(imageSecuritySection ?? (imageSecuritySection = ImageSecuritySection.GetConfiguration()));
 }