public Add ( |
||
subtitle | The subtitle to add. | |
Результат | void |
/* Public methods */ public SubtitleCollection Clone (SubtitleProperties propertiesClone) { SubtitleCollection collectionClone = new SubtitleCollection(); foreach (Subtitle subtitle in this.subtitles) { Subtitle subtitleClone = subtitle.Clone(propertiesClone); collectionClone.Add(subtitleClone); } return collectionClone; }
/* Public methods */ public SubtitleCollection Clone(SubtitleProperties propertiesClone) { SubtitleCollection collectionClone = new SubtitleCollection(); foreach (Subtitle subtitle in this.subtitles) { Subtitle subtitleClone = subtitle.Clone(propertiesClone); collectionClone.Add(subtitleClone); } return(collectionClone); }
private void ReadSubtitles (Encoding encoding, ParsingProperties properties, SubtitleCollection collection) { string[] lines = text.Split(new char[] {'\n'}); for (int i = 0; i < lines.Length; i++) { SubtitleText stext = ParseSubtitleText(lines[i]); Style style = new Style(); if(!stext.IsEmpty) { Subtitle subtitle = new Subtitle(null, stext, style); collection.Add(subtitle); } } }
private int ReadSubtitles (string text, int bodyIndex, int textLength, Regex subtitleRegex, SubtitleFormat format, ParsingProperties properties, SubtitleCollection collection, IncompleteSubtitleCollection incompleteSubtitles) { Subtitle previousSubtitle = null; /* Read the subtitles. BodyIndex points to the start of the subtitles, skipping its possible beginning text*/ while (bodyIndex < textLength) { Match match = subtitleRegex.Match(text, bodyIndex); if (match.Success) { Subtitle subtitle = ParseSubtitle(match, format, properties, previousSubtitle); collection.Add(subtitle); AddIncompleteSubtitleIfExists(text, match, bodyIndex, collection.Count, incompleteSubtitles); bodyIndex = match.Index + match.Length; previousSubtitle = subtitle; } else break; } return bodyIndex; }