// -------------------------------------------------------------------------------------------------------------------- // // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // // // Helper functions for handling structures // // -------------------------------------------------------------------------------------------------------------------- namespace HandBrakeWPF.Helpers { using System.Globalization; using System; /// /// Helper functions for handling structures /// internal static class TimeSpanHelper { /// /// Parses chapter time start value from a chapter marker input file. /// /// /// The raw string value parsed from the input file /// /// /// The . /// internal static TimeSpan ParseChapterTimeStart(string chapterStartRaw) { // Format: 02:35:05 and 02:35:05.2957333 return TimeSpan.ParseExact(chapterStartRaw, new[] { @"hh\:mm\:ss", // Handle whole seconds @"hh\:mm\:ss\.FFFFFFF" // Handle fraction seconds }, CultureInfo.InvariantCulture); } } }