示例#1
0
 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);
     }
 }
示例#2
0
 static RuleSection()
 {
     _instance = (RuleSection)ConfigurationManager.GetSection("voat.Rules");
 }