private void LoadFile(string[] tableTags, InputType type) { var filePath = CommonTools.OpenOneFile(excelSuffix); if (filePath != null) { TagChoose tagChoose = new TagChoose(tableTags); switch (type)//不用这个长度,我们在调用的时候指定一个类型,根据类型使用回调函数TODO { case InputType.IndexFile: tagChoose.sendTable += new TagChoose.Tabledelegate(tagChooseIndex_clicked); break; case InputType.TranslationFile: tagChoose.sendTable += new TagChoose.Tabledelegate(tagChooseOrg_clicked); break; case InputType.MappingFile: tagChoose.sendTable += new TagChoose.Tabledelegate(tagChooseSingle_clicked); break; default: tagChoose.sendTable += new TagChoose.Tabledelegate(tagChooseOrg_clicked); break; } textBox.Text += "Loading " + filePath + "...\n"; tagChoose.SetData(filePath); tagChoose.Show(); } }
private void LoadTransText(object sender, RoutedEventArgs e) { var filePath = CommonTools.OpenOneFile(excelSuffix); if (filePath != null) { string[] tableTags = { "UniqueId", "Source", "Target" }; TagChoose tagChoose = new TagChoose(tableTags); tagChoose.sendTable += new TagChoose.Tabledelegate(tagChooseText_clicked); textBox.Text += "Loading " + filePath + "\n"; tagChoose.SetData(filePath); tagChoose.Show(); } }
private void LoadDict(object sender, RoutedEventArgs e) { var filePath = CommonTools.OpenOneFile(excelSuffix); if (filePath != null) { string[] tableTags = { "待翻译文本", "目标文本" }; TagChoose tagChoose = new TagChoose(tableTags); tagChoose.sendTable += new TagChoose.Tabledelegate(tagChooseDict_clicked); textBox.Text = "Loading " + filePath + "\n"; tagChoose.SetData(filePath); tagChoose.Show(); } }