using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;
using System.Xml;
using ETD.Log;
namespace ETD.Data
{
///
/// 数据库访问接口配置
///
public class DataPropertyConfigurationHandler:IConfigurationSectionHandler
{
#region IConfigurationSectionHandler 成员
public object Create(object parent, object configContext, System.Xml.XmlNode section)
{
Dictionary databasePropertyList = new Dictionary();
XmlNodeList dbpList = section.SelectNodes("DatabaseProperty");
foreach (XmlNode node in dbpList)
{
DatabaseProperty dbp = new DatabaseProperty();
dbp.DatabaseType = GetDatabaseType(node.SelectSingleNode("DatabaseType").InnerText);
dbp.ConnectionString = node.SelectSingleNode("ConnectionString").InnerText;
databasePropertyList.Add(node.Attributes["name"].Value, dbp);
}
return databasePropertyList;
}
#endregion
}
}