Ejemplo n.º 1
0
        private static List <SubTimes> ExtractTimesToList(List <string> subtitleParts)
        {
            List <SubTimes> subTimesList = new List <SubTimes>();

            for (int i = 0; i < subtitleParts.Count; i += 9)
            {
                SubTimes subTimes = new SubTimes();
                subTimes.startTime = new TimeSpan(0, subtitleParts[i].ToInt(), subtitleParts[i + 1].ToInt(), subtitleParts[i + 2].ToInt(), subtitleParts[i + 3].ToInt());
                subTimes.endTime   = new TimeSpan(0, subtitleParts[i + 4].ToInt(), subtitleParts[i + 5].ToInt(), subtitleParts[i + 6].ToInt(), subtitleParts[i + 7].ToInt());
                subTimesList.Add(subTimes);
            }
            return(subTimesList);
        }
Ejemplo n.º 2
0
        private static string PrintTimeStamp(SubTimes subTimes)
        {
            string timestamp = string.Empty;

            timestamp = subTimes.startTime.Hours.ToString("00") + ":"
                        + subTimes.startTime.Minutes.ToString("00") + ":"
                        + subTimes.startTime.Seconds.ToString("00") + ","
                        + subTimes.startTime.Milliseconds.ToString("000").Substring(0, 3)
                        + " --> "
                        + subTimes.endTime.Hours.ToString("00") + ":"
                        + subTimes.endTime.Minutes.ToString("00") + ":"
                        + subTimes.endTime.Seconds.ToString("00") + ","
                        + subTimes.endTime.Milliseconds.ToString("000").Substring(0, 3);

            return(timestamp);
        }