Exemple #1
0
        private void DoCasingViaAPI(List <string> names)
        {
            Cursor.Current = Cursors.WaitCursor;
            var copyParagraphs = _subtitle.Paragraphs.Select(p => new Paragraph(p.StartTime, p.EndTime, p.Text)
            {
                Number = p.Number
            });

            var paragraphs = new List <Paragraph>(copyParagraphs);

            var seCasingApi = new SECasingApi();

            var context = new CasingContext
            {
                Names                   = names,
                CheckLastLine           = checkBoxCheckLastLine.Checked,
                Paragraphs              = paragraphs,
                UppercaseAfterLineBreak = checkBoxUppercaseAfterBreak.Checked,
            };

            seCasingApi.DoCasing(context);
            // seCasingApi.DoCasing(paragraphs, names.ToList());

            UpdateListView(_subtitle.Paragraphs, paragraphs);
            Cursor.Current = Cursors.Default;
        }
Exemple #2
0
        private void DoCasingViaAPI(List <string> names)
        {
            Cursor.Current = Cursors.WaitCursor;
            var paragraphs  = _subtitle.Paragraphs.Select(p => p.GetCopy()).ToList();
            var seCasingApi = new SECasingApi();

            var context = new CasingContext
            {
                Names      = names,
                Paragraphs = paragraphs,
            };

            seCasingApi.DoCasing(context);
            // seCasingApi.DoCasing(paragraphs, names.ToList());

            UpdateListView(_subtitle.Paragraphs, paragraphs);
            Cursor.Current = Cursors.Default;
        }