コード例 #1
0
    public ConvertExceptionInfo ConvertFinish(IExcelReader excelReader)
    {
        if (_convertCount > 0)
        {
            foreach (var item in _colInfo)
            {
                var colInfo = item.Value;

                var name    = string.Format("MoeLanguage{0}", item.Key);
                var content = colInfo.Txt.ToString();
                colInfo.Txt.Length = 0;
                colInfo.Txt.Append(TemplateReplace.Replace("Template/MoeConfig.txt", new Dictionary <string, string>()
                {
                    { "$TABLE_NAME$", name },
                    { "$TABLE_CONUT$", colInfo.Count.ToString() },
                    { "$TABLE_CONTENTS$", content },
                }));
                SystemUtil.Log(string.Format("Convert Count : [{0}], {1}", colInfo.Count, name));
            }
        }
        else
        {
            SystemUtil.Wran("[该表没有任何数据可以导出!]");
        }
        EventHandel?.OnConvertExcelEnd(_excelName);
        return(null);
    }
コード例 #2
0
        public ConvertExceptionInfo ConvertFinish(IExcelReader excelReader)
        {
            // if (_convertCount > 0)
            {
                var content = _excelTxt.ToString();
                _excelTxt.Length = 0;
                _excelTxt.Append(TemplateReplace.Replace("Template/MoeConfig.txt", new Dictionary <string, string>()
                {
                    { "$TABLE_NAME$", string.Format("Moe{0}", System.IO.Path.GetFileNameWithoutExtension(_excelName)) },
                    { "$TABLE_CONUT$", _convertCount.ToString() },
                    { "$TABLE_CONTENTS$", content },
                }));
                SystemUtil.Log(string.Format("Convert Count : [{0}]", _convertCount));
            }

            if (_convertCount <= 0)
            {
                SystemUtil.Wran("[该表没有任何数据可以导出!但还是导出!!]");
            }

            EventHandel?.OnConvertExcelEnd(_excelName);
            return(null);
        }