/// <summary>Initializes a new instance of the <see cref="Subtitle" /> class, given the /// global subtitles' properties and the subtitle's text and style.</summary> /// <param name="properties">The subtitles' properties.</param> /// <param name="text">The subtitle's text.</param> /// <param name="style">The subtitle's style.</param> public Subtitle (SubtitleProperties properties, SubtitleText text, Style style) { this.properties = properties; this.text = text; this.style = style; times = new Times(this); frames = new Frames(this); }
/// <summary>Initializes a new instance of the <see cref="Subtitle" /> class, given the /// global subtitles' properties and the subtitle's text and style.</summary> /// <param name="properties">The subtitles' properties.</param> /// <param name="text">The subtitle's text.</param> /// <param name="style">The subtitle's style.</param> public Subtitle(SubtitleProperties properties, SubtitleText text, Style style) { this.properties = properties; this.text = text; this.style = style; times = new Times(this); frames = new Frames(this); }
/* Private methods */ private void SetFieldsForDeepClone(SubtitleProperties properties, Times times, Frames frames, SubtitleText text, SubtitleText translation, Style style) { this.properties = properties; this.times = times; this.frames = frames; this.text = text; this.translation = translation; this.style = style; }
public object Clone() { SubtitleText clone = new SubtitleText(); foreach (string line in lines) { clone.lines.Add(line); } return(clone); }
/* Public methods */ /// <summary></summary> /// <remarks>SubtitleProperties is not cloned and should be set afterwards.</remarks> public Subtitle Clone(SubtitleProperties propertiesClone) { Subtitle subtitleClone = new Subtitle(); Times timesClone = this.times.Clone(subtitleClone); Frames framesClone = this.frames.Clone(subtitleClone); SubtitleText textClone = this.text.Clone() as SubtitleText; SubtitleText translationClone = (this.translation != null ? this.translation.Clone() as SubtitleText : null); Style styleClone = this.style.Clone() as Style; subtitleClone.SetFieldsForDeepClone(propertiesClone, timesClone, framesClone, textClone, translationClone, styleClone); return(subtitleClone); }
internal void ClearTranslation() { translation = null; }
public object Clone() { SubtitleText clone = new SubtitleText(); foreach (string line in lines) { clone.lines.Add(line); } return clone; }
/* Private methods */ private void SetFieldsForDeepClone (SubtitleProperties properties, Times times, Frames frames, SubtitleText text, SubtitleText translation, Style style) { this.properties = properties; this.times = times; this.frames = frames; this.text = text; this.translation = translation; this.style = style; }
internal void ClearTranslation () { translation = null; }
private void RenderTextCell (CellRendererText renderer, TreeIter iter, SubtitleText subtitleText, SubLib.Core.Domain.Style subtitleStyle) { /* If there's no text, return empty text without line count */ if (subtitleText.IsEmpty) { renderer.Text = String.Empty; return; } string textMarkup = String.Empty; string stylePrefix = String.Empty; string styleSuffix = String.Empty; GetStyleMarkup(subtitleStyle, ref stylePrefix, ref styleSuffix); bool first = true; bool viewLineLengths = Base.Config.PrefsViewLineLengths; foreach (string line in subtitleText) { textMarkup += (first ? String.Empty : "\n") + stylePrefix + GLib.Markup.EscapeText(line) + styleSuffix + (viewLineLengths ? " <span size=\"small\"><sup>(" + line.Length + ")</sup></span>" : String.Empty); if (first) first = false; } renderer.Markup = textMarkup; }