Beispiel #1
0
        private IEnumerable <Cue> ParseLoop(StreamReader reader)
        {
            while (!reader.EndOfStream)
            {
                var line = MoveToFirstNonEmptyLine(reader);
                if (string.IsNullOrEmpty(line))
                {
                    yield break;
                }

                if (!IsCounterLine(line))
                {
                    yield break;
                }

                var timeLine = reader.ReadLine();
                var(begin, end) = ParseTimeLine(timeLine);

                var text = ParserUtils.ParseText(reader);

                yield return(new Cue {
                    Text = text, Begin = begin, End = end
                });
            }
        }
Beispiel #2
0
        internal string ParseText(StreamReader reader)
        {
            var parsed = ParserUtils.ParseText(reader);

            return(WebUtility.HtmlDecode(parsed));
        }