Ejemplo n.º 1
0
        internal void Initialize(Logic.Subtitle subtitle, int firstSelectedIndex)
        {
            StringBuilder sb = new StringBuilder();
            foreach (Paragraph p in subtitle.Paragraphs)
                sb.AppendLine(p.Text);

            string watermark = ReadWaterMark(sb.ToString().Trim());
            LabelWatermark.Text = string.Format("Watermark: {0}", watermark);
            if (watermark.Length == 0)
            {
                buttonRemove.Enabled = false;
                textBoxWatermark.Focus();
            }
            else
            {
                groupBoxGenerate.Enabled = false;
                buttonOK.Focus();
            }

            _firstSelectedIndex = firstSelectedIndex;
            Paragraph current = subtitle.GetParagraphOrDefault(_firstSelectedIndex);
            if (current != null)
                radioButtonCurrentLine.Text = radioButtonCurrentLine.Text + " " + current.Text.Replace(Environment.NewLine, Configuration.Settings.General.ListViewLineSeparatorString);
            else
                radioButtonCurrentLine.Enabled = false;
        }