summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Utilities/Input
diff options
context:
space:
mode:
authorsr55 <[email protected]>2016-10-30 20:18:45 +0000
committersr55 <[email protected]>2016-10-30 20:18:45 +0000
commit5cc2fbbca69eaac36d85d63b09cc3af39cee2cf2 (patch)
treeb27c7cb02e6678fe85ef6f1f78b1ed4414572669 /win/CS/HandBrakeWPF/Utilities/Input
parent2c2947ac86ffbf4f5fa9111847ac31efd75c7d05 (diff)
WinGui: Fix a large number of stylecop warnings.
Diffstat (limited to 'win/CS/HandBrakeWPF/Utilities/Input')
-rw-r--r--win/CS/HandBrakeWPF/Utilities/Input/ChapterImporterCsv.cs24
-rw-r--r--win/CS/HandBrakeWPF/Utilities/Input/ChapterImporterTxt.cs23
-rw-r--r--win/CS/HandBrakeWPF/Utilities/Input/ChapterImporterXml.cs25
3 files changed, 48 insertions, 24 deletions
diff --git a/win/CS/HandBrakeWPF/Utilities/Input/ChapterImporterCsv.cs b/win/CS/HandBrakeWPF/Utilities/Input/ChapterImporterCsv.cs
index 8317f4c1a..7cf953adc 100644
--- a/win/CS/HandBrakeWPF/Utilities/Input/ChapterImporterCsv.cs
+++ b/win/CS/HandBrakeWPF/Utilities/Input/ChapterImporterCsv.cs
@@ -1,11 +1,17 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="ChapterImporterCsv.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// Handles the importing of Chapter information from CSV files
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
namespace HandBrakeWPF.Utilities.Input
{
+ using System;
+ using System.Collections.Generic;
+
using HandBrakeWPF.Exceptions;
using HandBrakeWPF.Properties;
@@ -24,8 +30,12 @@ namespace HandBrakeWPF.Utilities.Input
/// <summary>
/// Imports all chapter information from the given <see cref="filename"/> into the <see cref="chapterMap"/> dictionary.
/// </summary>
- /// <param name="filename">The full path and filename of the chapter marker file to import</param>
- /// <param name="chapterMap">The dictionary that should be populated with parsed chapter markers</param>
+ /// <param name="filename">
+ /// The full path and filename of the chapter marker file to import
+ /// </param>
+ /// <param name="importedChapters">
+ /// The imported Chapters.
+ /// </param>
public static void Import(string filename, ref Dictionary<int, Tuple<string, TimeSpan>> importedChapters)
{
using (TextFieldParser csv = new TextFieldParser(filename)
diff --git a/win/CS/HandBrakeWPF/Utilities/Input/ChapterImporterTxt.cs b/win/CS/HandBrakeWPF/Utilities/Input/ChapterImporterTxt.cs
index 55b24b7a1..f9e2acee9 100644
--- a/win/CS/HandBrakeWPF/Utilities/Input/ChapterImporterTxt.cs
+++ b/win/CS/HandBrakeWPF/Utilities/Input/ChapterImporterTxt.cs
@@ -1,11 +1,18 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="ChapterImporterTxt.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// Imports chapter markers in the ChaptersDb.org TXT format
+// More info: http://www.chapterdb.org/docs
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
namespace HandBrakeWPF.Utilities.Input
{
+ using System;
+ using System.Collections.Generic;
+ using System.Linq;
using System.IO;
using HandBrakeWPF.Helpers;
@@ -45,12 +52,12 @@ namespace HandBrakeWPF.Utilities.Input
break;
// Split the values on '=' and take the left side
- chapterName = chapterName.Split(new []{ '=' }, 2).LastOrDefault();
+ chapterName = chapterName.Split(new[] { '=' }, 2).LastOrDefault();
chapterStartRaw = chapterStartRaw.Split(new[] { '=' }, 2).LastOrDefault();
// Parse the time
- if(!string.IsNullOrWhiteSpace(chapterStartRaw))
- {
+ if (!string.IsNullOrWhiteSpace(chapterStartRaw))
+ {
var chapterStart = TimeSpanHelper.ParseChapterTimeStart(chapterStartRaw);
// If we're past the first chapter in the file then calculate the duration for the previous chapter
diff --git a/win/CS/HandBrakeWPF/Utilities/Input/ChapterImporterXml.cs b/win/CS/HandBrakeWPF/Utilities/Input/ChapterImporterXml.cs
index 565b49e3c..39c698c36 100644
--- a/win/CS/HandBrakeWPF/Utilities/Input/ChapterImporterXml.cs
+++ b/win/CS/HandBrakeWPF/Utilities/Input/ChapterImporterXml.cs
@@ -1,12 +1,17 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="ChapterImporterXml.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// Imports chapter markers in the ChaptersDb.org XML format
+// More info: http://www.chapterdb.org/docs
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
namespace HandBrakeWPF.Utilities.Input
{
- using System.Globalization;
+ using System;
+ using System.Collections.Generic;
using System.IO;
using System.Xml;
using System.Xml.Linq;
@@ -54,16 +59,18 @@ namespace HandBrakeWPF.Utilities.Input
}
var chapterStartRaw = chapter.XPathSelectElement("ChapterTimeStart")?.Value;
- if(!string.IsNullOrWhiteSpace(chapterStartRaw))
+ if (!string.IsNullOrWhiteSpace(chapterStartRaw))
{
- //Format: 02:35:05 and 02:35:05.2957333
+ // Format: 02:35:05 and 02:35:05.2957333
var chapterStart = TimeSpanHelper.ParseChapterTimeStart(chapterStartRaw);
// If we're past the first chapter in the file then calculate the duration for the previous chapter
if (chapterMapIdx > 1)
{
var old = chapterMap[chapterMapIdx - 1];
- chapterMap[chapterMapIdx-1] = new Tuple<string, TimeSpan>(old.Item1, chapterStart - prevChapterStart);
+ chapterMap[chapterMapIdx - 1] = new Tuple<string, TimeSpan>(
+ old.Item1,
+ chapterStart - prevChapterStart);
}
prevChapterStart = chapterStart;