Пример #1
0
        private void toolStripMenuItemMergeDuplicateText_Click(object sender, EventArgs e)
        {
            if (!IsSubtitleLoaded)
            {
                DisplaySubtitleNotLoadedMessage();
                return;
            }

            ReloadFromSourceView();
            using (var form = new MergeDoubleLines())
            {
                form.Initialize(_subtitle);
                if (form.ShowDialog(this) == DialogResult.OK)
                {
                    MakeHistoryForUndo(_language.BeforeMergeLinesWithSameText);
                    _subtitle.Paragraphs.Clear();
                    foreach (var p in form.MergedSubtitle.Paragraphs)
                        _subtitle.Paragraphs.Add(p);
                    ShowStatus(string.Format(_language.MergedShortLinesX, form.NumberOfMerges));
                    SaveSubtitleListviewIndices();
                    ShowSource();
                    SubtitleListview1.Fill(_subtitle, _subtitleAlternate);
                    RestoreSubtitleListviewIndices();
                }
            }
        }
Пример #2
0
 private void toolStripMenuItemMergeDuplicateText_Click(object sender, EventArgs e)
 {
     if (IsSubtitleLoaded)
     {
         ReloadFromSourceView();
         var form = new MergeDoubleLines();
         _formPositionsAndSizes.SetPositionAndSize(form);
         form.Initialize(_subtitle);
         if (form.ShowDialog(this) == DialogResult.OK)
         {
             if (!string.IsNullOrEmpty(_language.BeforeMergeLinesWithSameText)) //TODO: Remove in SE 3.3.4
                 MakeHistoryForUndo(_language.BeforeMergeLinesWithSameText);
             else
                 MakeHistoryForUndo(_language.BeforeMergeShortLines);
             _subtitle.Paragraphs.Clear();
             foreach (Paragraph p in form.MergedSubtitle.Paragraphs)
                 _subtitle.Paragraphs.Add(p);
             ShowStatus(string.Format(_language.MergedShortLinesX, form.NumberOfMerges));
             SaveSubtitleListviewIndexes();
             ShowSource();
             SubtitleListview1.Fill(_subtitle, _subtitleAlternate);
             RestoreSubtitleListviewIndexes();
         }
         _formPositionsAndSizes.SavePositionAndSize(form);
     }
     else
     {
         MessageBox.Show(_language.NoSubtitleLoaded, Title, MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }