private List <string> MakeWriteBackList()
        {
            List <string> lstWriteback = new List <string>();

            for (int id = 0; id < YMLText.Count; id++)
            {
                if (ChkSaveOnlyTranslated.Checked == true && YMLText.ElementAt(id).SameInToAndFrom())
                {
                    continue;
                }
                if (ChkSimplifiedChinese.Checked == true)
                {
                    lstWriteback.Add(YMLTools.ToSimplifiedChinese(YMLText.ElementAt(id).TranslatedLine)); continue;
                }
                if (ChkTraditionalChinese.Checked == true)
                {
                    lstWriteback.Add(YMLTools.ToTraditionalChinese(YMLText.ElementAt(id).TranslatedLine)); continue;
                }
                lstWriteback.Add(YMLText.ElementAt(id).TranslatedLine);
            }
            return(lstWriteback);
        }
Exemple #2
0
        private void FuncSave()
        {
            List <string> lstWriteback = new List <string>();

            for (int id = 0; id < YMLText.Count; id++)
            {
                if (ChkSaveOnlyTranslated.Checked == true && YMLText.ElementAt(id).SameInToAndFrom())
                {
                    continue;
                }
                if (ChkSimplifiedChinese.Checked == true)
                {
                    lstWriteback.Add(YMLTools.ToSimplifiedChinese(YMLText.ElementAt(id).TranslatedLine)); continue;
                }
                if (ChkTraditionalChinese.Checked == true)
                {
                    lstWriteback.Add(YMLTools.ToTraditionalChinese(YMLText.ElementAt(id).TranslatedLine)); continue;
                }
                lstWriteback.Add(YMLText.ElementAt(id).TranslatedLine);
            }
            File.WriteAllLines("chn\\" + LstFiles.Text, lstWriteback.ToArray(), Encoding.UTF8);
            BtnSave.Enabled = false;
            // 保存文件
        }