コード例 #1
0
        private void btnRemark_Click(object sender, EventArgs e)
        {
            //userRank = 4;// Convert.ToInt32(numUserVocabularyRank.Value);

            var subtitleWords = PickNewWords(subtitle.Bodies);

            if (subtitleWords.Count > 0)
            {
                NewWordConfirmForm form = new NewWordConfirmForm();
                form.DataSource       = subtitleWords.Values.ToList();
                form.SubtitleFileName = Path.GetFileName(txbSubtitleFilePath.Text);
                if (form.ShowDialog() == DialogResult.OK)
                {
                    Dictionary <string, SubtitleWord> result = new Dictionary <string, SubtitleWord>();
                    foreach (var subtitleWord in form.SelectedNewWords)
                    {
                        result.Add(subtitleWord.Word, subtitleWord);
                    }
                    var newSubtitle = new List <SubtitleLine>();
                    for (int i = 0; i < subtitle.Bodies.Count; i++)
                    {
                        var SubtitleLine = subtitle.Bodies[i];
                        SubtitleLine.EnglishTextWithMeans = StringAndRemarkString(SubtitleLine.EnglishText, result);
                        newSubtitle.Add(SubtitleLine);
                    }
                    subtitle.Bodies = newSubtitle;
                    ShowSubtitleText(newSubtitle, true);
                    ClearCache();
                }
            }
        }
コード例 #2
0
        private void btnRemark_Click(object sender, EventArgs e)
        {
            if (subtitle == null || subtitle.Bodies.Count == 0)
            {
                MessageBox.Show("请先点击“载入字幕”按钮打开字幕文件");
                return;
            }

            Splash.Show("解析字幕中...");

            sentenceParse = new SentenceParse();
            var subtitleWords = PickNewWords(subtitle.Bodies.Values);

            if (subtitleWords.Count > 0)
            {
                NewWordConfirmForm form = new NewWordConfirmForm();
                form.DataSource       = subtitleWords.Values.ToList();
                form.SubtitleFileName = Path.GetFileName(txbSubtitleFilePath.Text);
                form.OnClickOkButton += RemarkSubtitle;
                form.Show();
                form.Activate();
                //if (form.ShowDialog() == DialogResult.OK)
                //{

                //  form.SelectedNewWords
                //}
            }
            Splash.Close();
        }
コード例 #3
0
        private void btnRemark_Click(object sender, EventArgs e)
        {
            if (subtitle == null || subtitle.Bodies.Count == 0)
            {
                MessageBox.Show("请先点击“载入字幕”按钮打开字幕文件");
                return;
            }

            Splash.Show("解析字幕中...");

            sentenceParse = new SentenceParse();
            var subtitleWords = PickNewWords(subtitle.Bodies.Values);
            if (subtitleWords.Count > 0)
            {
                NewWordConfirmForm form = new NewWordConfirmForm();
                form.DataSource = subtitleWords.Values.ToList();
                form.SubtitleFileName = Path.GetFileName(txbSubtitleFilePath.Text);
                form.OnClickOkButton += RemarkSubtitle;
                form.Show();
                form.Activate();
                //if (form.ShowDialog() == DialogResult.OK)
                //{

                //  form.SelectedNewWords
                //}
            }
            Splash.Close();
        }