Ejemplo n.º 1
0
 static public CstringMemo GetInstence()
 {
     if (_instence == null)
     {
         _instence = new CstringMemo();
     }
     return(_instence);
 }
Ejemplo n.º 2
0
        protected override bool _OnInit(string v_strCellVal, string[] v_constraint)
        {
            if (!base._OnInit(v_strCellVal, v_constraint))
            {
                return(false);
            }
            CstringMemo memo = CstringMemo.GetInstence();

            memo.AddCstring(_data);
            return(true);
        }
Ejemplo n.º 3
0
        private void _btnOptWords_Click()
        {
            string excelPath = Config.excelPath;

            string[] files = Config.outputFiles;
            if (files == null)
            {
                files = Directory.GetFiles(excelPath, "*.xlsx");
            }
            CstringMemo memo = CstringMemo.GetInstence();

            memo.initByFile(Config.excelPath + Config.srcWordsFilePath);

            foreach (string v_filePath in files)
            {
                try
                {
                    if (!File.Exists(v_filePath))
                    {
                        Debug.Error("没有找到路径{0},程序退出,请检查xml配置", v_filePath);
                        workFinished();
                        return;
                    }

                    Excel.Workbook doc = new Excel.Workbook(v_filePath);
                    if (doc.Worksheets["INDEX"] == null)
                    {
                        continue;
                    }
                    updateTitle(string.Format("加载表 {0}", Path.GetFileNameWithoutExtension(v_filePath)));
                    updateDesc("正在加载文件......");
                    apposeReadExcel(v_filePath, false);
                }
                catch (Exception ex)
                {
                    Debug.Error("发生错误: " + ex.ToString());
                }
            }
            workFinished();
            memo.OutputMemoExcel(Config.excelPath + "\\Words\\Words.翻译-导出.xlsx");
            workFinished();
            Debug.Koid("导出完成");
        }