📄 rewriterconfigserializersectionhandler.cs
字号:
using System;
using System.Configuration;
using System.Xml;
using System.Xml.Serialization;
using System.Xml.XPath;
namespace Club.Common.URLRewriter.Config
{
/// <summary>
/// Deserializes the markup in Web.config into an instance of the <see cref="RewriterConfiguration"/> class.
/// </summary>
public class RewriterConfigSerializerSectionHandler : IConfigurationSectionHandler
{
/// <summary>
/// Creates an instance of the <see cref="RewriterConfiguration"/> class.
/// </summary>
/// <remarks>Uses XML Serialization to deserialize the XML in the Web.config file into an
/// <see cref="RewriterConfiguration"/> instance.</remarks>
/// <returns>An instance of the <see cref="RewriterConfiguration"/> class.</returns>
public object Create(object parent, object configContext, System.Xml.XmlNode section)
{
// Create an instance of XmlSerializer based on the RewriterConfiguration type...
XmlSerializer ser = new XmlSerializer(typeof(RewriterConfiguration));
// Return the Deserialized object from the Web.config XML
return ser.Deserialize(new XmlNodeReader(section));
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -