using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using System.Web;
namespace DogNet.Common.AppConfig
{
/// <summary>
/// 提供所有Xml配置文件的内存对象
/// </summary>
public static class XmlDataSource
{
#region 私有字段
private static XmlFileConfig _AllComDeptConfig;
#endregion
#region 构造函数
static XmlDataSource()
{
//string path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().CodeBase) + "\\Config\\";
//path = path.Replace("file:\\", "");
string path = HttpContext.Current.Request.PhysicalApplicationPath + "Config\\";
_AllComDeptConfig = new XmlFileConfig(path, "AllComDept.xml");
}
#endregion
#region 公有属性
/// <summary>
/// 所有公司级部门
/// </summary>
public static XDocument AllComDeptConfig
{
get
{
return _AllComDeptConfig.XmlDocument;
}
}
#endregion
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using System.Web;
namespace DogNet.Common.AppConfig
{
/// <summary>
/// 提供所有Xml配置文件的内存对象
/// </summary>
public static class XmlDataSource
{
#region 私有字段
private static XmlFileConfig _AllComDeptConfig;
#endregion
#region 构造函数
static XmlDataSource()
{
//string path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().CodeBase) + "\\Config\\";
//path = path.Replace("file:\\", "");
string path = HttpContext.Current.Request.PhysicalApplicationPath + "Config\\";
_AllComDeptConfig = new XmlFileConfig(path, "AllComDept.xml");
}
#endregion
#region 公有属性
/// <summary>
/// 所有公司级部门
/// </summary>
public static XDocument AllComDeptConfig
{
get
{
return _AllComDeptConfig.XmlDocument;
}
}
#endregion
}
}