コード例 #1
0
ファイル: Main.cs プロジェクト: m1croN/subtitleedit
        private void toolStripMenuItemAutoSplitLongLines_Click(object sender, EventArgs e)
        {
            if (!IsSubtitleLoaded)
            {
                DisplaySubtitleNotLoadedMessage();
                return;
            }

            ReloadFromSourceView();
            using (var splitLongLines = new SplitLongLines())
            {
                splitLongLines.Initialize(_subtitle);
                if (splitLongLines.ShowDialog(this) == DialogResult.OK)
                {
                    MakeHistoryForUndo(_language.BeforeMergeShortLines);
                    _subtitle.Paragraphs.Clear();
                    foreach (var p in splitLongLines.SplittedSubtitle.Paragraphs)
                        _subtitle.Paragraphs.Add(p);
                    ShowStatus(string.Format(_language.MergedShortLinesX, splitLongLines.NumberOfSplits));
                    SaveSubtitleListviewIndices();
                    ShowSource();
                    SubtitleListview1.Fill(_subtitle, _subtitleAlternate);
                    RestoreSubtitleListviewIndices();
                }
            }
        }
コード例 #2
0
ファイル: Main.cs プロジェクト: IlgnerBri/subtitleedit
 private void toolStripMenuItemAutoSplitLongLines_Click(object sender, EventArgs e)
 {
     if (IsSubtitleLoaded)
     {
         ReloadFromSourceView();
         var splitLongLines = new SplitLongLines();
         _formPositionsAndSizes.SetPositionAndSize(splitLongLines);
         splitLongLines.Initialize(_subtitle);
         if (splitLongLines.ShowDialog(this) == DialogResult.OK)
         {
             MakeHistoryForUndo(_language.BeforeMergeShortLines);
             _subtitle.Paragraphs.Clear();
             foreach (Paragraph p in splitLongLines.SplittedSubtitle.Paragraphs)
                 _subtitle.Paragraphs.Add(p);
             ShowStatus(string.Format(_language.MergedShortLinesX, splitLongLines.NumberOfSplits));
             SaveSubtitleListviewIndexes();
             ShowSource();
             SubtitleListview1.Fill(_subtitle, _subtitleAlternate);
             RestoreSubtitleListviewIndexes();
         }
         _formPositionsAndSizes.SavePositionAndSize(splitLongLines);
     }
     else
     {
         MessageBox.Show(_language.NoSubtitleLoaded, Title, MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }