Refactor (src/Logic/SubtitleFormats) part 4

This commit is contained in:
ivandrofly 2015-07-29 22:48:29 +01:00
parent 4b99e4052b
commit bdf07a864a
4 changed files with 4 additions and 6 deletions

View File

@ -112,8 +112,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
private static double ParseTimeCode(string start)
{
string[] arr = start.Split(':');
var ts = new TimeSpan(0, int.Parse(arr[0]), int.Parse(arr[1]), int.Parse(arr[2]), int.Parse(arr[3]));
return ts.TotalMilliseconds;
return new TimeSpan(0, int.Parse(arr[0]), int.Parse(arr[1]), int.Parse(arr[2]), int.Parse(arr[3])).TotalMilliseconds;
}
}

View File

@ -7,7 +7,6 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
{
public class UnknownSubtitle74 : SubtitleFormat
{
//07:02:27
//>> GOOD MORNING AND WELCOME TO THE FALL 2014 COMMENCEMENT CEREMONY, A TIME TO RECOGNIZE OUR GRADUATING SENIORS.
//07:02:43

View File

@ -42,14 +42,14 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
var sb = new StringBuilder();
foreach (Paragraph p in subtitle.Paragraphs)
{
sb.AppendFormat(paragraphWriteFormat, p.StartTime.ToString().Replace(",", "."), p.Text);
sb.AppendFormat(paragraphWriteFormat, p.StartTime.ToString().Replace(',', '.'), p.Text);
}
return sb.ToString().Trim();
}
public override void LoadSubtitle(Subtitle subtitle, List<string> lines, string fileName)
{
Paragraph paragraph = new Paragraph();
var paragraph = new Paragraph();
_errorCount = 0;
subtitle.Paragraphs.Clear();
for (int i = 0; i < lines.Count; i++)

View File

@ -52,7 +52,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
{
//<a class="caption" starttime="0" duration="16000">[♪techno music♪]</a>
StringBuilder temp = new StringBuilder();
var temp = new StringBuilder();
foreach (string l in lines)
temp.Append(l);
string all = temp.ToString();