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;
}