示例#1
0
 private void buttonOK_Click(object sender, EventArgs e)
 {
     _updateListview = false;
     _lineUnbreakerController.Action();
     Subtiitle    = _subtitle.ToText();
     DialogResult = DialogResult.OK;
 }
示例#2
0
文件: Main.cs 项目: ulffi/plugins
 private void buttonCleanup_Click(object sender, EventArgs e)
 {
     ReloadConfiguration();
     _wordHandler.CleanUpSubtitle(_subtitle);
     FixedSubtitle = _subtitle.ToText();
     DialogResult  = DialogResult.OK;
 }
示例#3
0
        private void buttonOK_Click(object sender, EventArgs e)
        {
            int count = 0;

            foreach (ListViewItem item in listViewFixes.Items)
            {
                if (item.Checked)
                {
                    var kvp = (KeyValuePair <char, List <Paragraph> >)item.Tag;
                    foreach (var paragraph in kvp.Value)
                    {
                        string replaceWith = string.Empty;
                        if (checkBoxUseReplaceList.Checked && _replaceList.ContainsKey(kvp.Key.ToString()))
                        {
                            replaceWith = _replaceList[kvp.Key.ToString()];
                        }
                        paragraph.Text = paragraph.Text.Replace(kvp.Key.ToString(), replaceWith);
                        count++;
                    }
                }
            }

            if (count > 0)
            {
                FixedSubtitle = _subtitle.ToText();
                DialogResult  = DialogResult.OK;
            }
            else
            {
                DialogResult = DialogResult.Cancel;
            }
        }
示例#4
0
 private void ButtonRemove_Click(object sender, EventArgs e)
 {
     foreach (Paragraph p in _subtitle.Paragraphs)
     {
         var text = p.Text;
         if (!text.ContainsColor())
         {
             continue;
         }
         text = HtmlUtils.RemoveOpenCloseTags(text, HtmlUtils.TagFont);
         if (text.ContainsColor() == false)
         {
             p.Text = text;
         }
     }
     Subtitle     = _subtitle.ToText();
     DialogResult = DialogResult.OK;
 }
示例#5
0
 private void buttonOK_Click(object sender, EventArgs e)
 {
     foreach (ListViewItem item in listViewFixes.CheckedItems)
     {
         var conversion = item.Tag as Conversion;
         conversion.Paragraph.Text = conversion.EditedText ?? conversion.ConvertedText;
     }
     FixedSubtitle = _subtitle.ToText();
     DialogResult  = DialogResult.OK;
 }
示例#6
0
 private void btn_Run_Click(object sender, EventArgs e)
 {
     if (listViewFixes.Items.Count > 0)
     {
         Cursor = Cursors.WaitCursor;
         listViewFixes.Resize -= listViewFixes_Resize;
         ApplyChanges(false);
         Cursor = Cursors.Default;
     }
     FixedSubtitle = _subtitle.ToText();
     DialogResult  = DialogResult.OK;
 }
示例#7
0
 private void buttonOk_Click(object sender, EventArgs e)
 {
     buttonNext_Click(null, null);
     this.FixedSubtitle = _subtitle.ToText(new SubRip());
     if (!string.IsNullOrEmpty(this.FixedSubtitle.Trim()))
     {
         DialogResult = System.Windows.Forms.DialogResult.OK;
     }
     else
     {
         DialogResult = DialogResult.Cancel;
     }
 }
示例#8
0
 private void buttonRemove_Click(object sender, EventArgs e)
 {
     if (_subtitle.Paragraphs.Count == 0)
     {
         return;
     }
     foreach (Paragraph p in _subtitle.Paragraphs)
     {
         var text = p.Text;
         if (!text.Contains("<font", StringComparison.OrdinalIgnoreCase))
         {
             continue;
         }
         var oldText = text;
         text = Utilities.RemoveHtmlColorTags(text);
         if (text != oldText)
         {
             p.Text = text;
         }
     }
     FixedSubtitle = _subtitle.ToText();
     DialogResult  = DialogResult.OK;
 }
示例#9
0
 private void buttonOK_Click(object sender, EventArgs e)
 {
     foreach (ListViewItem item in listView1.Items)
     {
         var p = item.Tag as Paragraph;
         if (!item.Checked | p == null)
         {
             continue;
         }
         if (FixedParagrahs.ContainsKey(p.Id))
         {
             p.Text = FixedParagrahs[p.Id];
         }
     }
     FixedSubtitle = _subtitle.ToText();
     DialogResult  = DialogResult.OK;
 }
示例#10
0
        private void buttonOK_Click(object sender, EventArgs e)
        {
            _updateListview = false;
            //_lineUnbreakerController.Action();
            foreach (ListViewItem lvi in listView1.Items)
            {
                // changes not accepted
                if (!lvi.Checked)
                {
                    continue;
                }

                // update paragraph with new text
                var prgEventArgs = (ParagraphEventArgs)lvi.Tag;
                prgEventArgs.Paragraph.Text = prgEventArgs.NewText;
            }
            Subtiitle    = _subtitle.ToText();
            DialogResult = DialogResult.OK;
        }
示例#11
0
 private void buttonOK_Click(object sender, EventArgs e)
 {
     if (_fixedParagraphs?.Count > 0)
     {
         foreach (ListViewItem item in listViewFixes.Items)
         {
             var p = (Paragraph)item.Tag;
             if (item.Checked && _fixedParagraphs.ContainsKey(p.ID))
             {
                 p.Text = _fixedParagraphs[p.ID];
             }
         }
         FixedSubtitle = _subtitle.ToText();
         DialogResult  = DialogResult.OK;
     }
     else
     {
         DialogResult = DialogResult.Cancel;
     }
 }
示例#12
0
 private void buttonOK_Click(object sender, EventArgs e)
 {
     FixedSubtitle = _subtitle.ToText();
     DialogResult  = DialogResult.OK;
 }
示例#13
0
 private void buttonOK_Click(object sender, EventArgs e)
 {
     _allowFixes = true;
     GeneratePreview();
     Subtitle = _subtitle.ToText();
 }
示例#14
0
 private void buttonOK_Click(object sender, EventArgs e)
 {
     _allowFixes = true;
     Applyfixes();
     Subtitle = _subtitle.ToText();
 }