public object Create(object parent, object configContext, XmlNode section) { try { RuleSection sectionConfig = null; XmlSerializer serializer = new XmlSerializer(typeof(RuleSection)); using (var reader = new XmlNodeReader(section)) { sectionConfig = (RuleSection)serializer.Deserialize(reader); } return(sectionConfig); } catch (Exception ex) { throw new ConfigurationErrorsException("Error parsing configuration for type " + typeof(RuleSection).FullName, ex, section); } }
static RuleSection() { _instance = (RuleSection)ConfigurationManager.GetSection("voat.Rules"); }