コード例 #1
0
        public static void LoadFuBenMap()
        {
            XElement xml      = null;
            string   fileName = "Config/FuBenMap.xml";

            try
            {
                xml = XElement.Load(Global.GameResPath(fileName));
                if (null == xml)
                {
                    throw new Exception(string.Format("加载系统xml配置文件:{0}, 失败。没有找到相关XML配置文件!", fileName));
                }
            }
            catch (Exception)
            {
                throw new Exception(string.Format("加载系统xml配置文件:{0}, 失败。没有找到相关XML配置文件!", fileName));
            }
            IEnumerable <XElement> nodes = xml.Elements();

            foreach (XElement node in nodes)
            {
                SystemXmlItem systemXmlItem = new SystemXmlItem
                {
                    XMLNode = node
                };
                FuBenManager.ParseXmlItem(systemXmlItem);
            }
        }