cnforum自定义配置节
webconfig
处理程序
namespace AspNetForums.Configuration
{
public class ForumConfiguration
{
public static ForumConfiguration GetConfig()
{
return (ForumConfiguration) ConfigurationSettings.GetConfig("forums/forums");
}
internal void LoadValuesFromConfigurationXml(XmlNode node) {}
}
internal class ForumsConfigurationHandler : IConfigurationSectionHandler
{
public virtual object Create(Object parent, Object context, XmlNode node)
{
ForumConfiguration config = new ForumConfiguration();
config.LoadValuesFromConfigurationXml(node);
return config;
}
}
}
<sectionGroup name="forums">
<section name="forums" type="AspNetForums.Configuration.ForumsConfigurationHandler, AspNetForums.Components" />
</sectionGroup>
<forums>
<forums>
</forums>
</forums>
<section name="forums" type="AspNetForums.Configuration.ForumsConfigurationHandler, AspNetForums.Components" />
</sectionGroup>
<forums>
<forums>
</forums>
</forums>
处理程序
namespace AspNetForums.Configuration
{
public class ForumConfiguration
{
public static ForumConfiguration GetConfig()
{
return (ForumConfiguration) ConfigurationSettings.GetConfig("forums/forums");
}
internal void LoadValuesFromConfigurationXml(XmlNode node) {}
}
internal class ForumsConfigurationHandler : IConfigurationSectionHandler
{
public virtual object Create(Object parent, Object context, XmlNode node)
{
ForumConfiguration config = new ForumConfiguration();
config.LoadValuesFromConfigurationXml(node);
return config;
}
}
}