DOGNET

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
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
    }
}

posted on 2010-05-18 10:39  DOGNET  阅读(208)  评论(0编辑  收藏  举报