From: sr55 Date: Sun, 30 Oct 2016 20:18:45 +0000 (+0000) Subject: WinGui: Fix a large number of stylecop warnings. X-Git-Tag: 1.0.0~156 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5cc2fbbca69eaac36d85d63b09cc3af39cee2cf2;p=handbrake WinGui: Fix a large number of stylecop warnings. --- diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/HBPresetTune.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/HBPresetTune.cs index e5c914fb1..e3ed4c06a 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/HBPresetTune.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/HBPresetTune.cs @@ -15,7 +15,7 @@ namespace HandBrake.ApplicationServices.Interop.Model.Encoding public class HBPresetTune { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// The name. diff --git a/win/CS/HandBrake.ApplicationServices/Services/Logging/LogService.cs b/win/CS/HandBrake.ApplicationServices/Services/Logging/LogService.cs index b0292ca31..d440f53f6 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Logging/LogService.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Logging/LogService.cs @@ -352,7 +352,9 @@ namespace HandBrake.ApplicationServices.Services.Logging } } - // Trigger the Event to notify any subscribers that the log has been reset. + /// + /// Trigger the Event to notify any subscribers that the log has been reset. + /// protected virtual void OnLogReset() { this.LogReset?.Invoke(this, System.EventArgs.Empty); diff --git a/win/CS/HandBrakeWPF/Commands/InputBindingTrigger.cs b/win/CS/HandBrakeWPF/Commands/InputBindingTrigger.cs index bed67aed8..9b1ed197c 100644 --- a/win/CS/HandBrakeWPF/Commands/InputBindingTrigger.cs +++ b/win/CS/HandBrakeWPF/Commands/InputBindingTrigger.cs @@ -94,7 +94,7 @@ namespace HandBrakeWPF.Commands return frameworkElement as Window; var parent = frameworkElement.Parent as FrameworkElement; - Debug.Assert(parent != null); + Debug.Assert(parent != null, "Null Parent"); return GetWindow(parent); } diff --git a/win/CS/HandBrakeWPF/Commands/PresetMenuSelectCommand.cs b/win/CS/HandBrakeWPF/Commands/PresetMenuSelectCommand.cs index ec64c2820..25a8e7404 100644 --- a/win/CS/HandBrakeWPF/Commands/PresetMenuSelectCommand.cs +++ b/win/CS/HandBrakeWPF/Commands/PresetMenuSelectCommand.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// +// // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // // @@ -17,11 +17,19 @@ namespace HandBrakeWPF.Commands using HandBrakeWPF.Services.Presets.Model; using HandBrakeWPF.ViewModels.Interfaces; + /// + /// The preset menu select command. + /// public class PresetMenuSelectCommand : ICommand { private readonly Preset preset; - /// Initializes a new instance of the class. + /// + /// Initializes a new instance of the class. + /// + /// + /// The preset. + /// public PresetMenuSelectCommand(Preset preset) { this.preset = preset; @@ -43,6 +51,9 @@ namespace HandBrakeWPF.Commands mvm.PresetSelect(this.preset); } + /// + /// The can execute changed. + /// public event EventHandler CanExecuteChanged; } } diff --git a/win/CS/HandBrakeWPF/Controls/SplitButton/SplitMenuButton.cs b/win/CS/HandBrakeWPF/Controls/SplitButton/SplitMenuButton.cs index eb8b5df0a..ce7a57bb9 100644 --- a/win/CS/HandBrakeWPF/Controls/SplitButton/SplitMenuButton.cs +++ b/win/CS/HandBrakeWPF/Controls/SplitButton/SplitMenuButton.cs @@ -136,7 +136,7 @@ namespace HandBrakeWPF.Controls.SplitButton this.logicalChild = current; current = LogicalTreeHelper.GetParent(current); } - while (null != current); + while (current != null); this.contextMenu.IsOpen = false; this.AddLogicalChild(this.logicalChild); @@ -174,7 +174,7 @@ namespace HandBrakeWPF.Controls.SplitButton /// protected override void OnKeyDown(KeyEventArgs e) { - if (null == e) + if (e == null) { throw new ArgumentNullException("e"); } @@ -194,7 +194,7 @@ namespace HandBrakeWPF.Controls.SplitButton /// protected void OpenButtonMenu() { - if ((0 < this.ItemSource.Count) && (null != this.contextMenu)) + if ((this.ItemSource.Count < 0) && (this.contextMenu != null)) { this.contextMenu.HorizontalOffset = 0; this.contextMenu.VerticalOffset = 0; diff --git a/win/CS/HandBrakeWPF/Converters/Audio/AudioEncoderConverter.cs b/win/CS/HandBrakeWPF/Converters/Audio/AudioEncoderConverter.cs index 0e538b5e3..b40f61071 100644 --- a/win/CS/HandBrakeWPF/Converters/Audio/AudioEncoderConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Audio/AudioEncoderConverter.cs @@ -56,7 +56,6 @@ namespace HandBrakeWPF.Converters.Audio List encoders = EnumHelper.GetEnumList().ToList(); EncodeTask task = values[1] as EncodeTask; - if (!HandBrakeEncoderHelpers.AudioEncoders.Any(a => a.ShortName.Contains("fdk"))) { encoders.Remove(AudioEncoder.fdkaac); diff --git a/win/CS/HandBrakeWPF/Converters/Audio/AudioMixdownListConverter.cs b/win/CS/HandBrakeWPF/Converters/Audio/AudioMixdownListConverter.cs index cad01f88a..432fdaaf7 100644 --- a/win/CS/HandBrakeWPF/Converters/Audio/AudioMixdownListConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Audio/AudioMixdownListConverter.cs @@ -68,7 +68,6 @@ namespace HandBrakeWPF.Converters.Audio /// The value that is produced by the binding target.The type to convert to.The converter parameter to use.The culture to use in the converter. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { - return value; } } diff --git a/win/CS/HandBrakeWPF/Converters/PresetsMenuConverter.cs b/win/CS/HandBrakeWPF/Converters/PresetsMenuConverter.cs index 9edce57d4..62012be3d 100644 --- a/win/CS/HandBrakeWPF/Converters/PresetsMenuConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/PresetsMenuConverter.cs @@ -20,6 +20,9 @@ namespace HandBrakeWPF.Converters using HandBrakeWPF.Commands; using HandBrakeWPF.Services.Presets.Model; + /// + /// The presets menu converter. + /// public class PresetsMenuConverter : IValueConverter { /// Converts a value. @@ -32,7 +35,7 @@ namespace HandBrakeWPF.Converters { IEnumerable presets = value as IEnumerable; - if (presets ==null) + if (presets == null) { return null; } diff --git a/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs b/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs index ec158e751..19969cbaa 100644 --- a/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs +++ b/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs @@ -39,6 +39,9 @@ namespace HandBrakeWPF.Helpers /// /// The Source or Label Name /// + /// + /// The preset Name. + /// /// /// The Generated FileName /// @@ -96,7 +99,7 @@ namespace HandBrakeWPF.Helpers .Replace(Constants.Title, dvdTitle) .Replace(Constants.Chapters, combinedChapterTag) .Replace(Constants.Date, DateTime.Now.Date.ToShortDateString().Replace('/', '-')) - .Replace(Constants.Time,DateTime.Now.ToString("HH:mm")) + .Replace(Constants.Time, DateTime.Now.ToString("HH:mm")) .Replace(Constants.Preset, sanitisedPresetName); if (task.VideoEncodeRateType == VideoEncodeRateType.ConstantQuality) diff --git a/win/CS/HandBrakeWPF/Helpers/LogManager.cs b/win/CS/HandBrakeWPF/Helpers/LogManager.cs index 70347fca1..f551af10e 100644 --- a/win/CS/HandBrakeWPF/Helpers/LogManager.cs +++ b/win/CS/HandBrakeWPF/Helpers/LogManager.cs @@ -43,10 +43,28 @@ namespace HandBrakeWPF.Helpers HandBrakeUtils.ErrorLogged += HandBrakeUtils_ErrorLogged; } + /// + /// Subscribe the ErrorLogged event. + /// + /// + /// The sender. + /// + /// + /// The e. + /// private static void HandBrakeUtils_ErrorLogged(object sender, HandBrake.ApplicationServices.Interop.EventArgs.MessageLoggedEventArgs e) { } + /// + /// Subscribe the MessageLogged event. + /// + /// + /// The sender. + /// + /// + /// The e. + /// private static void HandBrakeUtils_MessageLogged(object sender, HandBrake.ApplicationServices.Interop.EventArgs.MessageLoggedEventArgs e) { } diff --git a/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs b/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs index 90e3ab0ac..0604de331 100644 --- a/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs +++ b/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs @@ -119,6 +119,9 @@ namespace HandBrakeWPF.Helpers /// /// The error Service. /// + /// + /// The silent Recovery. + /// /// /// The . /// diff --git a/win/CS/HandBrakeWPF/Helpers/TimeSpanHelper.cs b/win/CS/HandBrakeWPF/Helpers/TimeSpanHelper.cs index 816b9ca82..91a4ee1d8 100644 --- a/win/CS/HandBrakeWPF/Helpers/TimeSpanHelper.cs +++ b/win/CS/HandBrakeWPF/Helpers/TimeSpanHelper.cs @@ -29,12 +29,9 @@ namespace HandBrakeWPF.Helpers 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); + return TimeSpan.ParseExact( + chapterStartRaw, + new[] { @"hh\:mm\:ss", @"hh\:mm\:ss\.FFFFFFF" }, CultureInfo.InvariantCulture); // Handle whole seconds then Handle fraction seconds } } } diff --git a/win/CS/HandBrakeWPF/Model/Audio/AudioBehaviourTrack.cs b/win/CS/HandBrakeWPF/Model/Audio/AudioBehaviourTrack.cs index b775c06b7..d5350439a 100644 --- a/win/CS/HandBrakeWPF/Model/Audio/AudioBehaviourTrack.cs +++ b/win/CS/HandBrakeWPF/Model/Audio/AudioBehaviourTrack.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// +// // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // // @@ -40,7 +40,7 @@ namespace HandBrakeWPF.Model.Audio private double? quality; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// public AudioBehaviourTrack() { @@ -55,7 +55,7 @@ namespace HandBrakeWPF.Model.Audio } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// Copy Constructor /// /// @@ -573,24 +573,24 @@ namespace HandBrakeWPF.Model.Audio /// private void GetDefaultMixdownIfNull() { - //if (this.ScannedTrack == null) - //{ + // if (this.ScannedTrack == null) + // { // return; - //} + // } - //HBAudioEncoder aencoder = HandBrakeEncoderHelpers.GetAudioEncoder(EnumHelper.GetShortName(this.encoder)); - //HBMixdown currentMixdown = HandBrakeEncoderHelpers.GetMixdown(this.mixDown); - //HBMixdown sanitisedMixdown = HandBrakeEncoderHelpers.SanitizeMixdown(currentMixdown, aencoder, (uint)this.ScannedTrack.ChannelLayout); - //HBMixdown defaultMixdown = HandBrakeEncoderHelpers.GetDefaultMixdown(aencoder, (uint)this.ScannedTrack.ChannelLayout); + // HBAudioEncoder aencoder = HandBrakeEncoderHelpers.GetAudioEncoder(EnumHelper.GetShortName(this.encoder)); + // HBMixdown currentMixdown = HandBrakeEncoderHelpers.GetMixdown(this.mixDown); + // HBMixdown sanitisedMixdown = HandBrakeEncoderHelpers.SanitizeMixdown(currentMixdown, aencoder, (uint)this.ScannedTrack.ChannelLayout); + // HBMixdown defaultMixdown = HandBrakeEncoderHelpers.GetDefaultMixdown(aencoder, (uint)this.ScannedTrack.ChannelLayout); - //if (this.mixDown == null || this.mixDown == "none") - //{ + // if (this.mixDown == null || this.mixDown == "none") + // { // this.MixDown = defaultMixdown.ShortName; - //} - //else if (sanitisedMixdown != null) - //{ + // } + // else if (sanitisedMixdown != null) + // { // this.MixDown = sanitisedMixdown.ShortName; - //} + // } } #endregion diff --git a/win/CS/HandBrakeWPF/Services/Encode/Model/EncodeTask.cs b/win/CS/HandBrakeWPF/Services/Encode/Model/EncodeTask.cs index 0203b0831..9663ae66c 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/Model/EncodeTask.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/Model/EncodeTask.cs @@ -511,6 +511,9 @@ namespace HandBrakeWPF.Services.Encode.Model #region MetaData + /// + /// Gets or sets the meta data. + /// public MetaData MetaData { get; set; } #endregion diff --git a/win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioTrack.cs b/win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioTrack.cs index 8e21820c2..bf5ea27d4 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioTrack.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/Model/Models/AudioTrack.cs @@ -96,9 +96,12 @@ namespace HandBrakeWPF.Services.Encode.Model.Models } /// + /// Initializes a new instance of the class. /// Create a track from a behaviour track. /// - /// The Behavior track + /// + /// The Behavior track + /// public AudioTrack(AudioBehaviourTrack track) { this.drc = track.DRC; diff --git a/win/CS/HandBrakeWPF/Services/Encode/Model/Models/MetaData.cs b/win/CS/HandBrakeWPF/Services/Encode/Model/Models/MetaData.cs index 5cf274ee9..e86212a39 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/Model/Models/MetaData.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/Model/Models/MetaData.cs @@ -9,16 +9,26 @@ namespace HandBrakeWPF.Services.Encode.Model.Models { + /// + /// The meta data. + /// public class MetaData { private string albumArtist; - /// Initializes a new instance of the class. + /// + /// Initializes a new instance of the class. + /// public MetaData() { } - /// Initializes a new instance of the class. + /// + /// Initializes a new instance of the class. + /// + /// + /// The metadata. + /// public MetaData(MetaData metadata) { if (metadata != null) diff --git a/win/CS/HandBrakeWPF/Services/Presets/Interfaces/IPresetService.cs b/win/CS/HandBrakeWPF/Services/Presets/Interfaces/IPresetService.cs index 4cc177a3d..fb46b932f 100644 --- a/win/CS/HandBrakeWPF/Services/Presets/Interfaces/IPresetService.cs +++ b/win/CS/HandBrakeWPF/Services/Presets/Interfaces/IPresetService.cs @@ -148,6 +148,12 @@ namespace HandBrakeWPF.Services.Presets.Interfaces /// /// Replace an existing preset with a modified one. /// + /// + /// The existing. + /// + /// + /// The replacement. + /// void Replace(Preset existing, Preset replacement); } } \ No newline at end of file diff --git a/win/CS/HandBrakeWPF/Services/Presets/Model/Preset.cs b/win/CS/HandBrakeWPF/Services/Presets/Model/Preset.cs index 4ecc0c502..04e2395ea 100644 --- a/win/CS/HandBrakeWPF/Services/Presets/Model/Preset.cs +++ b/win/CS/HandBrakeWPF/Services/Presets/Model/Preset.cs @@ -36,17 +36,18 @@ namespace HandBrakeWPF.Services.Presets.Model #endregion /// - /// Initializes a new instance of the class. - /// Creates an instance of . + /// Initializes a new instance of the class. /// public Preset() { } /// - /// Initializes a new instance of the class. - /// Creates an instance of . + /// Initializes a new instance of the class. /// + /// + /// The preset. + /// public Preset(Preset preset) { this.Category = preset.Category; diff --git a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs index 6c4a48864..8af0b3d03 100644 --- a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs +++ b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs @@ -256,6 +256,12 @@ namespace HandBrakeWPF.Services.Presets /// /// Replace an existing preset with a modified one. /// + /// + /// The existing. + /// + /// + /// The replacement. + /// public void Replace(Preset existing, Preset replacement) { this.Remove(existing); @@ -521,7 +527,6 @@ namespace HandBrakeWPF.Services.Presets PresetTransportContainer container = null; using (StreamReader reader = new StreamReader(this.presetFile)) { - try { container = JsonConvert.DeserializeObject(reader.ReadToEnd()); diff --git a/win/CS/HandBrakeWPF/Services/Queue/QueueProcessor.cs b/win/CS/HandBrakeWPF/Services/Queue/QueueProcessor.cs index afa167b9c..e9cce2b32 100644 --- a/win/CS/HandBrakeWPF/Services/Queue/QueueProcessor.cs +++ b/win/CS/HandBrakeWPF/Services/Queue/QueueProcessor.cs @@ -14,14 +14,11 @@ namespace HandBrakeWPF.Services.Queue using System.ComponentModel; using System.IO; using System.Linq; - using System.Runtime.InteropServices.WindowsRuntime; - using System.Windows; using System.Xml.Serialization; using HandBrake.ApplicationServices.Model; using HandBrakeWPF.Factories; - using HandBrakeWPF.Properties; using HandBrakeWPF.Services.Encode.Factories; using HandBrakeWPF.Services.Encode.Model; using HandBrakeWPF.Services.Interfaces; @@ -46,25 +43,12 @@ namespace HandBrakeWPF.Services.Queue /// A Lock object to maintain thread safety /// private static readonly object QueueLock = new object(); - - /// - /// The Queue of Job objects - /// + private readonly IUserSettingService userSettingService; + private readonly IErrorService errorService; private readonly BindingList queue = new BindingList(); - - /// - /// HandBrakes Queue file with a place holder for an extra string. - /// private readonly string queueFile; - - /// - /// The clear completed. - /// private bool clearCompleted; - private readonly IUserSettingService userSettingService; - private readonly IErrorService errorService; - #endregion #region Constructors and Destructors @@ -145,6 +129,9 @@ namespace HandBrakeWPF.Services.Queue /// public event EventHandler QueuePaused; + /// + /// The low diskspace detected. + /// public event EventHandler LowDiskspaceDetected; #endregion @@ -247,6 +234,9 @@ namespace HandBrakeWPF.Services.Queue /// /// Export the Queue the standardised JSON format. /// + /// + /// The export Path. + /// public void ExportJson(string exportPath) { List jobs = this.queue.Where(item => item.Status != QueueItemStatus.Completed).ToList(); @@ -640,6 +630,9 @@ namespace HandBrakeWPF.Services.Queue this.IsProcessing = false; } + /// + /// The on low diskspace detected. + /// protected virtual void OnLowDiskspaceDetected() { this.LowDiskspaceDetected?.Invoke(this, EventArgs.Empty); @@ -683,6 +676,5 @@ namespace HandBrakeWPF.Services.Queue } #endregion - } } \ No newline at end of file diff --git a/win/CS/HandBrakeWPF/Startup/StartupOptions.cs b/win/CS/HandBrakeWPF/Startup/StartupOptions.cs index 634d2ecac..98634634e 100644 --- a/win/CS/HandBrakeWPF/Startup/StartupOptions.cs +++ b/win/CS/HandBrakeWPF/Startup/StartupOptions.cs @@ -1,5 +1,5 @@ // -------------------------------------------------------------------------------------------------------------------- -// +// // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // // @@ -9,8 +9,14 @@ namespace HandBrakeWPF.Startup { + /// + /// The startup options. + /// public class StartupOptions { + /// + /// Gets or sets a value indicating whether auto restart queue. + /// public static bool AutoRestartQueue { get; set; } } } diff --git a/win/CS/HandBrakeWPF/Utilities/DirectoryUtilities.cs b/win/CS/HandBrakeWPF/Utilities/DirectoryUtilities.cs index 5461605d0..45450f4eb 100644 --- a/win/CS/HandBrakeWPF/Utilities/DirectoryUtilities.cs +++ b/win/CS/HandBrakeWPF/Utilities/DirectoryUtilities.cs @@ -38,7 +38,6 @@ namespace HandBrakeWPF.Utilities } } - /// /// Simple way of checking if a directory is writeable. /// @@ -48,7 +47,9 @@ namespace HandBrakeWPF.Utilities { try { - using (File.Create(Path.Combine(dirPath, Path.GetRandomFileName()), 1, FileOptions.DeleteOnClose)) { } + using (File.Create(Path.Combine(dirPath, Path.GetRandomFileName()), 1, FileOptions.DeleteOnClose)) + { + } return true; } catch 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; +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Handles the importing of Chapter information from CSV files +// +// -------------------------------------------------------------------------------------------------------------------- namespace HandBrakeWPF.Utilities.Input { + using System; + using System.Collections.Generic; + using HandBrakeWPF.Exceptions; using HandBrakeWPF.Properties; @@ -24,8 +30,12 @@ namespace HandBrakeWPF.Utilities.Input /// /// Imports all chapter information from the given into the dictionary. /// - /// The full path and filename of the chapter marker file to import - /// The dictionary that should be populated with parsed chapter markers + /// + /// The full path and filename of the chapter marker file to import + /// + /// + /// The imported Chapters. + /// public static void Import(string filename, ref Dictionary> 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; +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Imports chapter markers in the ChaptersDb.org TXT format +// More info: http://www.chapterdb.org/docs +// +// -------------------------------------------------------------------------------------------------------------------- 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; +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Imports chapter markers in the ChaptersDb.org XML format +// More info: http://www.chapterdb.org/docs +// +// -------------------------------------------------------------------------------------------------------------------- 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(old.Item1, chapterStart - prevChapterStart); + chapterMap[chapterMapIdx - 1] = new Tuple( + old.Item1, + chapterStart - prevChapterStart); } prevChapterStart = chapterStart; diff --git a/win/CS/HandBrakeWPF/ViewModels/AudioDefaultsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AudioDefaultsViewModel.cs index ec757034b..2a18d7a4b 100644 --- a/win/CS/HandBrakeWPF/ViewModels/AudioDefaultsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/AudioDefaultsViewModel.cs @@ -340,7 +340,6 @@ namespace HandBrakeWPF.ViewModels /// public IEnumerable Mixdowns { get; set; } - /// /// Gets or sets AudioBitrates. /// diff --git a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs index 232ed3567..9f3cd760d 100644 --- a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs @@ -109,7 +109,6 @@ namespace HandBrakeWPF.ViewModels /// public EncodeTask Task { get; set; } - /// /// Gets the panel title. /// diff --git a/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs index 037bacde0..da65e2945 100644 --- a/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs @@ -208,8 +208,10 @@ namespace HandBrakeWPF.ViewModels string validationErrorMessage; if (!this.ValidateImportedChapters(importedChapters, out validationErrorMessage)) { - if( !string.IsNullOrEmpty(validationErrorMessage)) - throw new GeneralApplicationException(Resources.ChaptersViewModel_ValidationFailedWarning, validationErrorMessage); + if (!string.IsNullOrEmpty(validationErrorMessage)) + throw new GeneralApplicationException( + Resources.ChaptersViewModel_ValidationFailedWarning, + validationErrorMessage); // The user has cancelled the import, so exit return; diff --git a/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs index 7cb50ac37..3c5e13f82 100644 --- a/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs @@ -15,8 +15,6 @@ namespace HandBrakeWPF.ViewModels using Caliburn.Micro; - using HandBrake.ApplicationServices.Interop; - using HandBrake.ApplicationServices.Interop.HbLib; using HandBrake.ApplicationServices.Interop.Model.Encoding; using HandBrakeWPF.Services.Interfaces; @@ -267,6 +265,9 @@ namespace HandBrakeWPF.ViewModels } } + /// + /// Gets or sets the selected comb detect preset. + /// public CombDetect SelectedCombDetectPreset { get @@ -295,6 +296,9 @@ namespace HandBrakeWPF.ViewModels } } + /// + /// Gets or sets the custom comb detect. + /// public string CustomCombDetect { get @@ -551,6 +555,9 @@ namespace HandBrakeWPF.ViewModels } } + /// + /// The rotation options. + /// public BindingList RotationOptions => new BindingList { 0, 90, 180, 270 }; /// @@ -638,7 +645,6 @@ namespace HandBrakeWPF.ViewModels this.CustomDetelecine = preset.Task.CustomDetelecine; this.CustomDenoise = preset.Task.CustomDenoise; - this.SelectedRotation = preset.Task.Rotation; this.FlipVideo = preset.Task.FlipVideo; } @@ -685,7 +691,6 @@ namespace HandBrakeWPF.ViewModels this.NotifyOfPropertyChange(() => this.FlipVideo); this.NotifyOfPropertyChange(() => this.SelectedRotation); - } /// diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IMainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IMainViewModel.cs index 539e239a5..17f460123 100644 --- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IMainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IMainViewModel.cs @@ -25,6 +25,12 @@ namespace HandBrakeWPF.ViewModels.Interfaces /// Preset SelectedPreset { set; } + /// + /// The preset select. + /// + /// + /// The tag. + /// void PresetSelect(object tag); /// diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IManagePresetViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IManagePresetViewModel.cs index 2af41b1de..29ff92929 100644 --- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IManagePresetViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IManagePresetViewModel.cs @@ -19,6 +19,9 @@ namespace HandBrakeWPF.ViewModels.Interfaces /// /// Prepare the Preset window /// + /// + /// The preset. + /// void Setup(Preset preset); /// diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IMetaDataViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IMetaDataViewModel.cs index 1e62880c2..63f36f4fe 100644 --- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IMetaDataViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IMetaDataViewModel.cs @@ -9,6 +9,9 @@ namespace HandBrakeWPF.ViewModels.Interfaces { + /// + /// The MetaDataViewModel interface. + /// public interface IMetaDataViewModel : ITabInterface { } diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 823d95f09..b1e231412 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -283,7 +283,7 @@ namespace HandBrakeWPF.ViewModels public IStaticPreviewViewModel StaticPreviewViewModel { get; set; } /// - /// The MetaData View Model + /// Gets or sets the The MetaData View Model /// public IMetaDataViewModel MetaDataViewModel { get; set; } @@ -1195,6 +1195,9 @@ namespace HandBrakeWPF.ViewModels #region Commands + /// + /// Gets or sets the queue command. + /// public ICommand QueueCommand { get; set; } #endregion @@ -1400,7 +1403,6 @@ namespace HandBrakeWPF.ViewModels return false; } - // Sanity check the filename if (!string.IsNullOrEmpty(this.Destination) && FileHelper.FilePathHasInvalidChars(this.Destination)) { @@ -1678,7 +1680,7 @@ namespace HandBrakeWPF.ViewModels /// /// Pass on the "When Done" Action to the queue view model. /// - /// + /// action public void WhenDone(string action) { this.QueueViewModel?.WhenDone(action); diff --git a/win/CS/HandBrakeWPF/ViewModels/ManagePresetViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/ManagePresetViewModel.cs index 2f559bb65..7f0fed5b6 100644 --- a/win/CS/HandBrakeWPF/ViewModels/ManagePresetViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/ManagePresetViewModel.cs @@ -59,6 +59,9 @@ namespace HandBrakeWPF.ViewModels /// /// Prepare the Preset window to create a Preset Object later. /// + /// + /// The preset To Edit. + /// public void Setup(Preset presetToEdit) { this.Preset = new Preset(presetToEdit); // Clone. We will not touch the existing object. diff --git a/win/CS/HandBrakeWPF/ViewModels/MetaDataViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MetaDataViewModel.cs index 7e6efb3a0..e0bd332d1 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MetaDataViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MetaDataViewModel.cs @@ -17,14 +17,24 @@ namespace HandBrakeWPF.ViewModels using HandBrakeWPF.Services.Presets.Model; using HandBrakeWPF.Services.Scan.Model; using HandBrakeWPF.ViewModels.Interfaces; + + /// + /// The meta data view model. + /// public class MetaDataViewModel : ViewModelBase, IMetaDataViewModel { private EncodeTask task; private MetaData metaData; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// + /// + /// The window Manager. + /// + /// + /// The user Setting Service. + /// public MetaDataViewModel(IWindowManager windowManager, IUserSettingService userSettingService) { this.Task = new EncodeTask(); @@ -52,6 +62,9 @@ namespace HandBrakeWPF.ViewModels } } + /// + /// Gets or sets the meta data. + /// public MetaData MetaData { get diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs index b1962e48b..125939054 100644 --- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs @@ -109,6 +109,9 @@ namespace HandBrakeWPF.ViewModels /// /// The about View Model. /// + /// + /// The error Service. + /// public OptionsViewModel(IUserSettingService userSettingService, IUpdateService updateService, IAboutViewModel aboutViewModel, IErrorService errorService) { this.Title = "Options"; diff --git a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs index 3ad23d605..eed3a1a79 100644 --- a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs @@ -430,7 +430,6 @@ namespace HandBrakeWPF.ViewModels this.queueProcessor.JobProcessingStarted -= this.QueueProcessorJobProcessingStarted; this.queueProcessor.LowDiskspaceDetected -= this.QueueProcessor_LowDiskspaceDetected; - base.OnDeactivate(close); } diff --git a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs index b08122abd..fdc2886c7 100644 --- a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs @@ -558,7 +558,7 @@ namespace HandBrakeWPF.ViewModels // Setup the encode task as a preview encode encodeTask.IsPreviewEncode = true; - encodeTask.PreviewEncodeStartAt = this.SelectedPreviewImage +1; + encodeTask.PreviewEncodeStartAt = this.SelectedPreviewImage + 1; encodeTask.PreviewEncodeDuration = this.Duration; QueueTask task = new QueueTask(encodeTask, HBConfigurationFactory.Create(), this.ScannedSource.ScanPath); ThreadPool.QueueUserWorkItem(this.CreatePreview, task); @@ -591,7 +591,7 @@ namespace HandBrakeWPF.ViewModels // Attempt to find VLC if it doesn't exist in the default set location. string vlcPath; - if (8 == IntPtr.Size || (!String.IsNullOrEmpty(Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432")))) + if (IntPtr.Size == 8 || (!String.IsNullOrEmpty(Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432")))) vlcPath = Environment.GetEnvironmentVariable("ProgramFiles(x86)"); else vlcPath = Environment.GetEnvironmentVariable("ProgramFiles"); diff --git a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs index 4f75359f4..55a679ea7 100644 --- a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs @@ -931,7 +931,6 @@ namespace HandBrakeWPF.ViewModels this.VideoBitrate = preset.Task.VideoEncodeRateType == VideoEncodeRateType.AverageBitrate ? preset.Task.VideoBitrate : null; - this.NotifyOfPropertyChange(() => this.Task); if (preset.Task != null) @@ -1336,7 +1335,6 @@ namespace HandBrakeWPF.ViewModels || this.SelectedVideoEncoder == VideoEncoder.QuickSync || this.SelectedVideoEncoder == VideoEncoder.QuickSyncH265; - // Refresh Display this.NotifyOfPropertyChange(() => this.Rfqp); this.NotifyOfPropertyChange(() => this.ShowAdvancedTab); diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml.cs b/win/CS/HandBrakeWPF/Views/MainView.xaml.cs index 53381b749..636705b65 100644 --- a/win/CS/HandBrakeWPF/Views/MainView.xaml.cs +++ b/win/CS/HandBrakeWPF/Views/MainView.xaml.cs @@ -53,6 +53,15 @@ namespace HandBrakeWPF.Views } } + /// + /// Add to Queue button context menu handling. + /// + /// + /// The sender. + /// + /// + /// The e. + /// private void AddToQueue_PreviewMouseDown(object sender, MouseButtonEventArgs e) { // If we've clicked the dropdown part of the button, display the context menu below the button. diff --git a/win/CS/HandBrakeWPF/Views/MetaDataView.xaml.cs b/win/CS/HandBrakeWPF/Views/MetaDataView.xaml.cs index 467f6b8a8..608a547cb 100644 --- a/win/CS/HandBrakeWPF/Views/MetaDataView.xaml.cs +++ b/win/CS/HandBrakeWPF/Views/MetaDataView.xaml.cs @@ -1,28 +1,27 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Interaction logic for MetaDataView.xaml +// +// -------------------------------------------------------------------------------------------------------------------- namespace HandBrakeWPF.Views { + using System.Windows.Controls; + /// /// Interaction logic for MetaDataView.xaml /// public partial class MetaDataView : UserControl { + /// + /// Initializes a new instance of the class. + /// public MetaDataView() { - InitializeComponent(); + this.InitializeComponent(); } } } diff --git a/win/CS/Settings.StyleCop b/win/CS/Settings.StyleCop index 0dc5564f9..ee7ed6fae 100644 --- a/win/CS/Settings.StyleCop +++ b/win/CS/Settings.StyleCop @@ -59,6 +59,11 @@ False + + + False + + HandBrake Project (http://handbrake.fr) @@ -138,6 +143,11 @@ False + + + False + + @@ -213,6 +223,16 @@ False + + + False + + + + + False + +