internal void Initialize(Ebu.EbuGeneralSubtitleInformation header, byte justificationCode, string fileName, Subtitle subtitle) { _header = header; _subtitle = subtitle; FillFromHeader(header); if (!string.IsNullOrEmpty(fileName)) { try { FillHeaderFromFile(fileName); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine("EbuOptions unable to read existing file: " + fileName + " - " + ex.Message); } string title = Path.GetFileNameWithoutExtension(fileName); if (title.Length > 32) title = title.Substring(0, 32).Trim(); textBoxOriginalProgramTitle.Text = title; } comboBoxJustificationCode.SelectedIndex = justificationCode; this.Text = Configuration.Settings.Language.EbuSaveOtpions.Title; buttonOK.Text = Configuration.Settings.Language.General.OK; buttonCancel.Text = Configuration.Settings.Language.General.Cancel; }
private void toolStripMenuItemEbuProperties_Click(object sender, EventArgs e) { using (var properties = new EbuSaveOptions()) { if (this._subtitle != null && this._subtitle.Header != null && (this._subtitle.Header.Contains("STL2") || this._subtitle.Header.Contains("STL3"))) { var header = Ebu.ReadHeader(Encoding.UTF8.GetBytes(this._subtitle.Header)); properties.Initialize(header, 0, null, this._subtitle); } else { var header = new Ebu.EbuGeneralSubtitleInformation(); if (!string.IsNullOrEmpty(this._fileName) && new Ebu().IsMine(null, this._fileName)) { properties.Initialize(header, 0, this._fileName, this._subtitle); } else { properties.Initialize(header, 0, null, this._subtitle); } } properties.ShowDialog(this); } }