Ejemplo n.º 1
0
 private void LineUnbreakerControllerTextUnbreaked(object sender, ParagraphEventArgs e)
 {
     // Update View
     if (_updateListview)
     {
         _totalFixed++;
         AddToListView(e.Paragraph, e.NewText);
     }
     else // Invoked by button OK.
     {
         e.Paragraph.Text = e.NewText;
     }
 }
Ejemplo n.º 2
0
        private void AddToListView(ParagraphEventArgs prgEventArgs)
        {
            string noTagOldText = HtmlUtils.RemoveTags(prgEventArgs.Paragraph.Text);

            // length of only visilbe characters
            int lineLength = noTagOldText.Length - (StringUtils.CountTagInText(noTagOldText, Environment.NewLine) * Environment.NewLine.Length);

            var item = new ListViewItem(string.Empty)
            {
                Checked = true,
                UseItemStyleForSubItems = true,
                SubItems =
                {
                    prgEventArgs.Paragraph.Number.ToString(),
                    lineLength.ToString(CultureInfo.InvariantCulture),                // line length
                    StringUtils.GetListViewString(prgEventArgs.Paragraph.Text, true), // old text
                    StringUtils.GetListViewString(prgEventArgs.NewText, true)         // new text
                },
                Tag = prgEventArgs
            };

            listView1.Items.Add(item);
        }