Пример #1
0
        /// <summary>
        /// 通过配置文件获取所有游戏信息
        /// </summary>
        /// <returns></returns>
        static List <RecordModel> GetGameByFile()
        {
            if (!File.Exists(_file_path))
            {
                CreateFile();
            }

            return((from file in XDocument.Load(_file_path).Element("Games").Elements("Game")
                    select RecordModel.CreateModel(
                        file.Attribute("file").Value,
                        file.Attribute("time").Value
                        )
                    ).ToList());
        }