示例#1
0
        static void ReadProjectJSONResourceFromFile(ProjectTypeEnum project, Dictionary <LangTypeEnum, string> jsonFile)
        {
            var langJsonResource = new Dictionary <LangTypeEnum, Dictionary <string, string> >();

            foreach (var item in jsonFile)
            {
                var jsonResource = ReadProjectJSONResourceFromFile(project, item.Value);
                langJsonResource.Add(item.Key, jsonResource);
            }
            LanguageCachedHelper.SetJsonResource(project, langJsonResource);
        }
示例#2
0
        /// <summary>
        /// 读取JSON资源文件
        /// </summary>
        /// <param name="project">项目</param>
        /// <param name="jsonFile">json文件</param>
        static void ReadProjectJSONResourceFromFile(ProjectTypeEnum project)
        {
            var jsonFile = GetJSONFileNameByProject(project);

            try
            {
                var langJsonResource = new Dictionary <LangTypeEnum, Dictionary <string, string> >();
                foreach (var item in jsonFile)
                {
                    var jsonResource = ReadProjectJSONResourceFromFile(item.Value);
                    langJsonResource.Add(item.Key, jsonResource);
                }
                LanguageCachedHelper.SetJsonResource(project, langJsonResource);
            }
            catch (System.Exception ex)
            {
                throw new ApplicationException(string.Format("An error occurred when reading json resource file, detai:{0}", ex.Message), ex);
            }
        }