示例#1
0
        /// <summary>
        /// 汉化bom
        /// 只显示汉化字典里面有的数据
        /// </summary>
        private IList <Dictionary <string, object> > makeZhsBom(IList <Dictionary <string, object> > boms)
        {
            IList <Dictionary <string, object> > zhsBoms = new List <Dictionary <string, object> >();

            if (boms == null)
            {
                return(zhsBoms);
            }
            foreach (var bom in boms)
            {
                var zshBom = new Dictionary <string, object>();
                foreach (var pair in bom)
                {
                    //bom字典里面是下划线,而变量名是骆驼峰
                    var key = YUtil.CamelToUnderScore(pair.Key);
                    if (HmiConfig.CraftBomZhsDict.TryGetValue(key, out var zhs))
                    {
                        zshBom[zhs] = pair.Value;
                    }
                }
                zhsBoms.Add(zshBom);
            }
            return(zhsBoms);
        }