www.pudn.com > CustomFormsDesigner.rar > XmlSerializerSectionHandler.cs, change:2004-10-26,size:630b


using System; 
using System.Xml; 
using System.Xml.XPath; 
using System.Xml.Serialization; 
using System.Configuration; 
 
namespace FormDesigner 
{ 
	public class XmlSerializerSectionHandler : IConfigurationSectionHandler 
	{ 
		object IConfigurationSectionHandler.Create(object parent, object configContext, XmlNode section) 
		{ 
			XPathNavigator navigator1 = section.CreateNavigator(); 
			string text1 = (string) navigator1.Evaluate("string(@type)"); 
			Type type1 = Type.GetType(text1); 
			XmlSerializer serializer1 = new XmlSerializer(type1); 
			return serializer1.Deserialize(new XmlNodeReader(section)); 
		} 
	} 
}