1234567891011121314151617181920212223242526272829303132333435 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Configuration;
- using System.Xml;
- using ETD.Log;
- namespace ETD.Data
- {
- /// <summary>
- /// 数据库访问接口配置
- /// </summary>
- public class DataPropertyConfigurationHandler:IConfigurationSectionHandler
- {
-
- #region IConfigurationSectionHandler 成员
- public object Create(object parent, object configContext, System.Xml.XmlNode section)
- {
- Dictionary<string, DatabaseProperty> databasePropertyList = new Dictionary<string, DatabaseProperty>();
- 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
-
- }
- }
|