]> granicus.if.org Git - handbrake/commitdiff
WinGui: Fix a number of stylecop warnings.
authorsr55 <sr55.hb@outlook.com>
Sat, 11 Feb 2017 20:37:33 +0000 (20:37 +0000)
committersr55 <sr55.hb@outlook.com>
Sat, 11 Feb 2017 20:37:33 +0000 (20:37 +0000)
47 files changed:
win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs
win/CS/HandBrake.ApplicationServices/Interop/HandBrakeLanguagesHelper.cs
win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/MetaData.cs
win/CS/HandBrake.ApplicationServices/Model/HBConfiguration.cs
win/CS/HandBrake.ApplicationServices/Services/Logging/LogService.cs
win/CS/HandBrakeWPF/App.xaml.cs
win/CS/HandBrakeWPF/AttachedProperties/MenuItemExtensions.cs
win/CS/HandBrakeWPF/Commands/ProcessShortcutCommand.cs
win/CS/HandBrakeWPF/Controls/Loading.xaml.cs
win/CS/HandBrakeWPF/Controls/SplitButton/SplitMenuButton.cs
win/CS/HandBrakeWPF/Controls/StatusPanel.xaml.cs
win/CS/HandBrakeWPF/Converters/Audio/AudioEncoderConverter.cs
win/CS/HandBrakeWPF/Converters/Audio/AudioMixdownConverter.cs
win/CS/HandBrakeWPF/Converters/Audio/AudioMixdownListConverter.cs
win/CS/HandBrakeWPF/Converters/BooleanConverter.cs
win/CS/HandBrakeWPF/Converters/BooleanToHiddenVisibilityConverter.cs
win/CS/HandBrakeWPF/Converters/BooleanToVisibilityConverter.cs
win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs
win/CS/HandBrakeWPF/Converters/PresetsMenuConverter.cs
win/CS/HandBrakeWPF/Converters/Queue/PictureSettingsDescConveter.cs
win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs
win/CS/HandBrakeWPF/Converters/Video/VideoOptionsTooltipConverter.cs
win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs
win/CS/HandBrakeWPF/Helpers/PictureSize.cs
win/CS/HandBrakeWPF/Helpers/TimeSpanHelper.cs
win/CS/HandBrakeWPF/Model/Audio/AudioBehaviourTrack.cs
win/CS/HandBrakeWPF/Services/ErrorService.cs
win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs
win/CS/HandBrakeWPF/Services/Presets/Model/Preset.cs
win/CS/HandBrakeWPF/Services/Queue/QueueProcessor.cs
win/CS/HandBrakeWPF/Services/UpdateService.cs
win/CS/HandBrakeWPF/Utilities/DirectoryUtilities.cs
win/CS/HandBrakeWPF/Utilities/ExtensionMethods.cs
win/CS/HandBrakeWPF/Utilities/GeneralUtilities.cs
win/CS/HandBrakeWPF/Utilities/Input/ChapterImporterTxt.cs
win/CS/HandBrakeWPF/Utilities/Portable.cs
win/CS/HandBrakeWPF/Utilities/SystemInfo.cs
win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs
win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs
win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
win/CS/HandBrakeWPF/ViewModels/ManagePresetViewModel.cs
win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs
win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs

index f803887d19591eff7be60c2d01c55089cd27f331..de0f0b2bc6cbc05eaaec1bed5fd033e6c1b8cef9 100644 (file)
@@ -216,6 +216,9 @@ namespace HandBrake.ApplicationServices.Interop
         /// <param name="titleIndex">\r
         /// The title index to scan (1-based, 0 for all titles).\r
         /// </param>\r
+        /// <param name="clEnabled">\r
+        /// OpenCL enabled. \r
+        /// </param>\r
         public void StartScan(string path, int previewCount, TimeSpan minDuration, int titleIndex, bool clEnabled = false)\r
         {\r
             this.previewCount = previewCount;\r
@@ -513,9 +516,6 @@ namespace HandBrake.ApplicationServices.Interop
             }\r
         }\r
 \r
-        /// <summary>\r
-        /// Checks the status of the ongoing encode.\r
-        /// </summary>\r
         /// <summary>\r
         /// Checks the status of the ongoing encode.\r
         /// </summary>\r
index b77c2b9a650bc822e809689b7c8d1d28bdc68a07..34328003115f9eecbe3039d4a0920283eb48b16a 100644 (file)
@@ -18,7 +18,7 @@ namespace HandBrake.ApplicationServices.Interop
     /// <summary>\r
     /// Contains utilities for converting language codes.\r
     /// </summary>\r
-    public static class Languages\r
+    public static class HandBrakeLanguagesHelper\r
     {\r
         /// <summary>\r
         /// The list of all languages.\r
index d840d5d7f03787ec99c8543dc9d11209559cfe32..c193527eb5931cf70bc6e28d3dfc96cb33cdf673 100644 (file)
@@ -1,5 +1,5 @@
 // --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="MetaData.cs" company="HandBrake Project (http://handbrake.fr)">\r
+// <copyright file="Metadata.cs" company="HandBrake Project (http://handbrake.fr)">\r
 //   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
 // </copyright>\r
 // <summary>\r
index 6290004c8f64a47e92248393d728320bf7ba809b..f8b2eb69f74a60381dc214914d35ff648d1cbea0 100644 (file)
@@ -57,7 +57,7 @@ namespace HandBrake.ApplicationServices.Model
         /// <summary>\r
         /// Gets or sets a value indicating whether save log with video.\r
         /// </summary>\r
-        public bool SaveLogWithVideo{ get; set; }\r
+        public bool SaveLogWithVideo { get; set; }\r
 \r
         /// <summary>\r
         /// Gets or sets the save log copy directory.\r
index 95a1ec515fc067469d1ff7cae629b4756bb9d61d..ef869570a710994d264b5a15daf5f1a5d51a4cf1 100644 (file)
@@ -33,7 +33,7 @@ namespace HandBrake.ApplicationServices.Services.Logging
         // Make this class Thread Safe.
         private static ILog loggerInstance;
         private readonly object lockObject = new object();
-        private readonly object FileWriterLock = new object();
+        private readonly object fileWriterLock = new object();
         private readonly StringBuilder logBuilder = new StringBuilder();
  
         private LogLevel currentLogLevel = LogLevel.Error;
@@ -198,7 +198,7 @@ namespace HandBrake.ApplicationServices.Services.Logging
                 this.isDiskLoggingEnabled = true;
                 this.deleteLogFirst = deleteCurrentLogFirst;
 
-                lock (this.FileWriterLock)
+                lock (this.fileWriterLock)
                 {
                     this.fileWriter = new StreamWriter(logFile) { AutoFlush = true };
                 }
@@ -209,7 +209,7 @@ namespace HandBrake.ApplicationServices.Services.Logging
 
                 if (this.fileWriter != null)
                 {
-                    lock (this.FileWriterLock)
+                    lock (this.fileWriterLock)
                     {
                         this.fileWriter.Flush();
                         this.fileWriter.Close();
@@ -252,7 +252,7 @@ namespace HandBrake.ApplicationServices.Services.Logging
                
                 try
                 {
-                    lock (this.FileWriterLock)
+                    lock (this.fileWriterLock)
                     {
                         if (this.fileWriter != null)
                         {
@@ -299,7 +299,7 @@ namespace HandBrake.ApplicationServices.Services.Logging
 
             try
             {
-                lock (this.FileWriterLock)
+                lock (this.fileWriterLock)
                 {
                     if (this.fileWriter != null && this.fileWriter.BaseStream.CanWrite)
                     {
@@ -335,7 +335,7 @@ namespace HandBrake.ApplicationServices.Services.Logging
         {
             try
             {
-                lock (this.FileWriterLock)
+                lock (this.fileWriterLock)
                 {
                     if (this.fileWriter != null)
                     {
index 73971ff08d1e63c4a00a163cb1c8e4eeb5927962..85f4e39028023d60348549153b09856056b09e19 100644 (file)
@@ -46,8 +46,8 @@ namespace HandBrakeWPF
         /// </param>\r
         protected override void OnStartup(StartupEventArgs e)\r
         {\r
-            OperatingSystem OS = Environment.OSVersion;\r
-            if ((OS.Platform == PlatformID.Win32NT) && (OS.Version.Major == 5 && OS.Version.Minor <= 1))\r
+            OperatingSystem os = Environment.OSVersion;\r
+            if ((os.Platform == PlatformID.Win32NT) && (os.Version.Major == 5 && os.Version.Minor <= 1))\r
             {\r
                 MessageBox.Show("Windows XP and earlier are no longer supported. Version 0.9.9 was the last version to support these versions. ", "Notice", MessageBoxButton.OK, MessageBoxImage.Warning);\r
                 Application.Current.Shutdown();\r
index e08cf59c6abcb34114a55d226a4908fd3a330618..4654d7ba283040c385e7fc37917df058c36d9aad 100644 (file)
@@ -9,7 +9,6 @@
 \r
 namespace HandBrakeWPF.AttachedProperties\r
 {\r
-    using System;\r
     using System.Collections.Generic;\r
     using System.Windows;\r
     using System.Windows.Controls;\r
@@ -28,12 +27,12 @@ namespace HandBrakeWPF.AttachedProperties
             "GroupName", \r
             typeof(string), \r
             typeof(MenuItemExtensions), \r
-            new PropertyMetadata(String.Empty, OnGroupNameChanged));\r
+            new PropertyMetadata(string.Empty, OnGroupNameChanged));\r
 \r
         /// <summary>\r
         /// The element to group names.\r
         /// </summary>\r
-        public static Dictionary<MenuItem, String> ElementToGroupNames = new Dictionary<MenuItem, String>();\r
+        public static Dictionary<MenuItem, string> ElementToGroupNames = new Dictionary<MenuItem, string>();\r
 \r
         #endregion\r
 \r
index 06c566991753858849c677840f7c7ff5497a9c27..3a50c36e3f6b2b076fb1a9b4645656ff45452ea6 100644 (file)
@@ -91,7 +91,7 @@ namespace HandBrakeWPF.Commands
                 }\r
 \r
                 // Scan a Folder (Ctrl+Shift+O)\r
-                if (gesture.Modifiers == (ModifierKeys.Control | ModifierKeys.Shift)  && gesture.Key == Key.O)\r
+                if (gesture.Modifiers == (ModifierKeys.Control | ModifierKeys.Shift) && gesture.Key == Key.O)\r
                 {\r
                     mainViewModel.FolderScan();\r
                 }\r
index 102788492b2e7a5db555e539748a6b42c2739b3e..5f1a8353355f22b8c2202c2752204db1028391f5 100644 (file)
@@ -9,10 +9,10 @@
 \r
 namespace HandBrakeWPF.Controls\r
 {\r
-    using System.Windows.Threading;\r
     using System;\r
     using System.Windows;\r
     using System.Windows.Controls;\r
+    using System.Windows.Threading;\r
 \r
     /// <summary>\r
     /// Interaction logic for Loading.xaml\r
index 5003068d1494a2b22503630bfb09db7fbc375e6f..adf17eb46eb3e056a28a350ff31770bc92306274 100644 (file)
@@ -179,7 +179,7 @@ namespace HandBrakeWPF.Controls.SplitButton
                 throw new ArgumentNullException("e");\r
             }\r
 \r
-            if (Key.Down == e.Key || Key.Up == e.Key)\r
+            if (e.Key == Key.Down || e.Key == Key.Up)\r
             {\r
                 this.Dispatcher.BeginInvoke((Action)this.OpenButtonMenu);\r
             }\r
@@ -286,7 +286,7 @@ namespace HandBrakeWPF.Controls.SplitButton
 \r
             this.contextMenu.HorizontalOffset = desiredOffset.X - currentOffset.X;\r
             this.contextMenu.VerticalOffset = desiredOffset.Y - currentOffset.Y;\r
-            if (FlowDirection.RightToLeft == this.FlowDirection)\r
+            if (this.FlowDirection == FlowDirection.RightToLeft)\r
             {\r
                 this.contextMenu.HorizontalOffset *= -1;\r
             }\r
index 64e27951720efb0b84d5f4264017bbbe4ef9fff5..02dabfe50f66a0c772ab49c54730196271a7ca38 100644 (file)
@@ -149,13 +149,13 @@ namespace HandBrakeWPF.Controls
         }\r
 \r
         /// <summary>\r
-        /// \r
+        /// Gets a value indicating whether is action 2 button visible.\r
         /// </summary>\r
         public bool IsActionButton2Visibile\r
         {\r
             get\r
             {\r
-                return true; //SecondaryAction != null;\r
+                return true; // SecondaryAction != null;\r
             }\r
         }\r
 \r
index b40f61071139eb61e41a0c83671bb72bad3857a7..7f70288ce8e8ea3b3be79045d5daadb8827f34de 100644 (file)
@@ -118,7 +118,7 @@ namespace HandBrakeWPF.Converters.Audio
             string name = value as string;\r
             if (!string.IsNullOrEmpty(name))\r
             {\r
-                return new object[] { EnumHelper<AudioEncoder>.GetValue(name)};\r
+                return new object[] { EnumHelper<AudioEncoder>.GetValue(name) };\r
             }\r
 \r
             return null;\r
index e1a3717435ffdd484cdc3cfe14498376e97ea5ae..0ef315fba5a465e1e6ac6e40483567390e605ee8 100644 (file)
@@ -9,10 +9,9 @@
 
 namespace HandBrakeWPF.Converters.Audio
 {
+    using System;
     using System.Globalization;
     using System.Windows.Data;
-    using System;
-
     using HandBrake.ApplicationServices.Interop;
     using HandBrake.ApplicationServices.Interop.Model.Encoding;
 
index 432fdaaf7fcafac1740275ebfaaf865407520d9c..df108d961876a5d655c037c39e8d9fe16c1b96ab 100644 (file)
@@ -9,14 +9,12 @@
 
 namespace HandBrakeWPF.Converters.Audio
 {
-    using System.Globalization;
-    using System.Windows.Data;
     using System;
     using System.ComponentModel;
-
+    using System.Globalization;
+    using System.Windows.Data;
     using HandBrake.ApplicationServices.Interop;
     using HandBrake.ApplicationServices.Interop.Model.Encoding;
-
     using HandBrakeWPF.Services.Encode.Model.Models;
     using HandBrakeWPF.Utilities;
 
index a01b3bf673db755e3da40803a212344b1750d465..5273a3210d85d2480d609d8607ccb6c0425d85c5 100644 (file)
@@ -9,9 +9,9 @@
 \r
 namespace HandBrakeWPF.Converters\r
 {\r
+    using System;\r
     using System.Globalization;\r
     using System.Windows.Data;\r
-    using System;\r
 \r
     /// <summary>\r
     /// Boolean to Visibility Converter\r
@@ -41,7 +41,7 @@ namespace HandBrakeWPF.Converters
             // Paramater is a boolean which inverts the output.\r
             var param = System.Convert.ToBoolean(parameter, CultureInfo.InvariantCulture);\r
 \r
-            if (value is Boolean)\r
+            if (value is bool)\r
             {\r
                 return param ? !(bool)value : value;\r
             }\r
index c6a66e1f6333dd0f65bec8c02f1ae612bddac61e..d60ab33c3f078ea11eba368d1c780909e8ff87a6 100644 (file)
@@ -9,10 +9,10 @@
 \r
 namespace HandBrakeWPF.Converters\r
 {\r
+    using System;\r
     using System.Globalization;\r
     using System.Windows;\r
     using System.Windows.Data;\r
-    using System;\r
 \r
     /// <summary>\r
     /// Boolean to Visibility Converter (Hidden, not Collasped)\r
@@ -47,7 +47,7 @@ namespace HandBrakeWPF.Converters
                 return Visibility.Hidden;\r
             }\r
 \r
-            if (value is Boolean)\r
+            if (value is bool)\r
             {\r
                 if (param)\r
                 {\r
index 31da7ed74d64b73d0d1690eb3e2a7280c198c3bf..6c9d7fd1215c888f9363cab7b642e3ce37ed0639 100644 (file)
@@ -9,10 +9,10 @@
 \r
 namespace HandBrakeWPF.Converters\r
 {\r
+    using System;\r
     using System.Globalization;\r
     using System.Windows;\r
     using System.Windows.Data;\r
-    using System;\r
 \r
     /// <summary>\r
     /// Boolean to Visibility Converter\r
@@ -47,7 +47,7 @@ namespace HandBrakeWPF.Converters
                 return Visibility.Collapsed;\r
             }\r
 \r
-            if (value is Boolean)\r
+            if (value is bool)\r
             {\r
                 if (param)\r
                 {\r
index b803e112628cdef0d75eb530f5fc8aade75a6cee..91c30311a87bc78855779286e80d977fb2d9cbc6 100644 (file)
@@ -9,17 +9,14 @@
 \r
 namespace HandBrakeWPF.Converters\r
 {\r
+    using System;\r
     using System.Collections.Generic;\r
     using System.Globalization;\r
     using System.Windows.Data;\r
-    using System;\r
-\r
-    using HandBrake.ApplicationServices.Model;\r
     using HandBrake.ApplicationServices.Interop.Model.Encoding;\r
-\r
+    using HandBrake.ApplicationServices.Model;\r
     using HandBrakeWPF.Services.Queue.Model;\r
     using HandBrakeWPF.Utilities;\r
-\r
     using OutputFormat = HandBrakeWPF.Services.Encode.Model.Models.OutputFormat;\r
     using PresetPictureSettingsMode = HandBrakeWPF.Model.Picture.PresetPictureSettingsMode;\r
 \r
index 62012be3d78d6179faee2892858b88ba8b632452..098d9e952826faee9e54a21995e3b29d65503e80 100644 (file)
@@ -45,7 +45,7 @@ namespace HandBrakeWPF.Converters
             {
                 if (groupedMenu.ContainsKey(item.Category))
                 {
-                    MenuItem newMeuItem = new MenuItem { Header = item.Name, Tag = item, Command = new PresetMenuSelectCommand(item)};
+                    MenuItem newMeuItem = new MenuItem { Header = item.Name, Tag = item, Command = new PresetMenuSelectCommand(item) };
                     if (item.IsDefault)
                     {
                         newMeuItem.FontStyle = FontStyles.Italic;
index 9af228b0e5f934e9426772605378435462b47c66..7b7cbc2207a91758cf8ade04874894f2c433b6bc 100644 (file)
@@ -9,12 +9,10 @@
 
 namespace HandBrakeWPF.Converters.Queue
 {
+    using System;
     using System.Globalization;
     using System.Windows.Data;
-    using System;
-
     using HandBrake.ApplicationServices.Interop.Model.Encoding;
-
     using HandBrakeWPF.Services.Encode.Model;
 
     /// <summary>
index 16559f8d031dde0fccf129e35dab1660861c4975..d0e7cf556760b5757dad8ede92e77a87d303e853 100644 (file)
@@ -16,7 +16,6 @@ namespace HandBrakeWPF.Converters.Video
     using System.Windows.Data;\r
 \r
     using HandBrake.ApplicationServices.Interop;\r
-    using HandBrake.ApplicationServices.Utilities;\r
     using HandBrake.ApplicationServices.Interop.Model.Encoding;\r
 \r
     using HandBrakeWPF.Utilities;\r
@@ -121,7 +120,7 @@ namespace HandBrakeWPF.Converters.Video
             string name = value as string;\r
             if (!string.IsNullOrEmpty(name))\r
             {\r
-                return new object[] { EnumHelper<VideoEncoder>.GetValue(name)};\r
+                return new object[] { EnumHelper<VideoEncoder>.GetValue(name) };\r
             }\r
 \r
             return null;\r
index 01265f228b57992505d9efd02e3f700ab42bd053..4a6c036c43479307226a374bbae4afc4d7f9ba26 100644 (file)
@@ -13,7 +13,6 @@ namespace HandBrakeWPF.Converters.Video
     using System.Globalization;\r
     using System.Windows.Data;\r
 \r
-    using HandBrake.ApplicationServices.Utilities;\r
     using HandBrake.ApplicationServices.Interop.Model.Encoding;\r
 \r
     using HandBrakeWPF.Utilities;\r
index 47a852a0c08482cc8d85b97bc696de7072aa949f..3465cfadf4e33ac20a70662594c55a5741e3a966 100644 (file)
@@ -58,7 +58,7 @@ namespace HandBrakeWPF.Helpers
             {\r
                 // Get the Source Name and remove any invalid characters\r
                 string sourceName = Path.GetInvalidFileNameChars().Aggregate(sourceOrLabelName, (current, character) => current.Replace(character.ToString(), string.Empty));\r
-              //  string sanitisedPresetName = presetName != null ? Path.GetInvalidFileNameChars().Aggregate(presetName.Name, (current, character) => current.Replace(character.ToString(), string.Empty)) : string.Empty;\r
+                // string sanitisedPresetName = presetName != null ? Path.GetInvalidFileNameChars().Aggregate(presetName.Name, (current, character) => current.Replace(character.ToString(), string.Empty)) : string.Empty;\r
 \r
                 // Remove Underscores\r
                 if (userSettingService.GetUserSetting<bool>(UserSettingConstants.AutoNameRemoveUnderscore))\r
@@ -99,7 +99,7 @@ namespace HandBrakeWPF.Helpers
                             .Replace(Constants.Chapters, combinedChapterTag)\r
                             .Replace(Constants.Date, DateTime.Now.Date.ToShortDateString().Replace('/', '-'))\r
                             .Replace(Constants.Time, DateTime.Now.ToString("HH:mm"));\r
-                           // .Replace(Constants.Preset, sanitisedPresetName);\r
+                    // .Replace(Constants.Preset, sanitisedPresetName);\r
 \r
                     if (task.VideoEncodeRateType == VideoEncodeRateType.ConstantQuality)\r
                     {\r
@@ -108,12 +108,16 @@ namespace HandBrakeWPF.Helpers
                     }\r
                     else\r
                     {\r
-                        destinationFilename = destinationFilename.Replace(Constants.Bitrate, task.VideoBitrate.ToString());\r
+                        destinationFilename = destinationFilename.Replace(\r
+                            Constants.Bitrate,\r
+                            task.VideoBitrate.ToString());\r
                         destinationFilename = destinationFilename.Replace(Constants.Quality, string.Empty);\r
                     }\r
                 }\r
                 else\r
+                {\r
                     destinationFilename = sourceName + "_T" + dvdTitle + "_C" + combinedChapterTag;\r
+                }\r
 \r
                 /*\r
                  * File Extension\r
@@ -134,7 +138,9 @@ namespace HandBrakeWPF.Helpers
                     }\r
                 }\r
                 else if (task.OutputFormat == OutputFormat.Mkv)\r
+                {\r
                     destinationFilename += ".mkv";\r
+                }\r
 \r
                 /*\r
                  * File Destination Path\r
@@ -177,11 +183,15 @@ namespace HandBrakeWPF.Helpers
                     {\r
                         autoNamePath = Path.Combine(userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNamePath), destinationFilename);\r
                     }\r
-                    else // ...otherwise, output to the source directory\r
+                    else \r
+                    {\r
+                        // ...otherwise, output to the source directory\r
                         autoNamePath = null;\r
+                    }\r
                 }\r
-                else // Otherwise, use the path that is already there.\r
+                else\r
                 {\r
+                    // Otherwise, use the path that is already there.\r
                     // Use the path and change the file extension to match the previous destination\r
                     autoNamePath = Path.Combine(Path.GetDirectoryName(task.Destination), destinationFilename);\r
                 }\r
index 40c73251a11eae9c924fa20c892637c775f93316..93b85e6e4d2c308e3fcd4d1b4512e3a58277962e 100644 (file)
@@ -186,7 +186,7 @@ namespace HandBrakeWPF.Helpers
                 maxHeight = job.MaxHeight,\r
                 mode = (int)job.AnamorphicMode,\r
                 modulus = job.Modulus.HasValue ? job.Modulus.Value : 16,\r
-                geometry = new hb_geometry_s { height = job.Height, width = job.Width, par = job.AnamorphicMode != Anamorphic.Custom ? new hb_rational_t { den = title.ParH, num = title.ParW } : new hb_rational_t { den = job.ParH, num = job.ParW }}\r
+                geometry = new hb_geometry_s { height = job.Height, width = job.Width, par = job.AnamorphicMode != Anamorphic.Custom ? new hb_rational_t { den = title.ParH, num = title.ParW } : new hb_rational_t { den = job.ParH, num = job.ParW } }\r
             };\r
 \r
             hb_geometry_s sourceGeometry = new hb_geometry_s\r
index 91a4ee1d8e099bc3a889e2fc7c7a908ee420a0b6..e3f4dfb59fd1c4eb796b6cd4de4be8e7df5a24b7 100644 (file)
@@ -9,8 +9,8 @@
 
 namespace HandBrakeWPF.Helpers
 {
-    using System.Globalization;
     using System;
+    using System.Globalization;
 
     /// <summary>
     /// Helper functions for handling <see cref="TimeSpan"/> structures
index d5350439a96a4de7ec9736b2db8f70520f99b45c..78c20d52c3eaaa96c2c4eec58ace7c91d6e02dc4 100644 (file)
@@ -12,16 +12,13 @@ namespace HandBrakeWPF.Model.Audio
     using System.Collections.Generic;
     using System.Globalization;
     using System.Linq;
-
     using HandBrake.ApplicationServices.Interop;
     using HandBrake.ApplicationServices.Interop.Model;
     using HandBrake.ApplicationServices.Interop.Model.Encoding;
-
+    using Newtonsoft.Json;
     using Services.Encode.Model.Models;
     using Utilities;
 
-    using Newtonsoft.Json;
-
     /// <summary>
     /// Model of a HandBrake Audio Track and it's associated behaviours.
     /// </summary>
index 3228ab363a06841fd5621995a11e3a3316e8233f..21c04cd58eb520f21518bd2c3e0ee59b9ab0b3e5 100644 (file)
@@ -11,8 +11,8 @@ namespace HandBrakeWPF.Services
 {\r
     using System;\r
     using System.Windows;\r
-    using Interfaces;\r
     using Caliburn.Micro;\r
+    using Interfaces;\r
     using ViewModels.Interfaces;\r
 \r
     /// <summary>\r
index 9afdafd9acefdb3d26c3ae34a6b397f1ff257910..59307e5edde810a5745acd69a6453540e0022889 100644 (file)
@@ -602,7 +602,6 @@ namespace HandBrakeWPF.Services.Presets.Factories
                 ? "decomb"\r
                 : export.Task.DeinterlaceFilter == DeinterlaceFilter.Yadif ? "yadif" : "off";\r
 \r
-\r
             preset.PictureDeinterlacePreset = export.Task.DeinterlaceFilter == DeinterlaceFilter.Decomb\r
                 ? EnumHelper<Decomb>.GetShortName(export.Task.Decomb)\r
                 : export.Task.DeinterlaceFilter == DeinterlaceFilter.Yadif ? EnumHelper<Deinterlace>.GetShortName(export.Task.Deinterlace) : string.Empty;\r
@@ -621,7 +620,6 @@ namespace HandBrakeWPF.Services.Presets.Factories
             preset.PictureDenoiseTune = EnumHelper<DenoiseTune>.GetShortName(export.Task.DenoiseTune);\r
             preset.PictureDetelecine = EnumHelper<Detelecine>.GetShortName(export.Task.Detelecine);\r
             preset.PictureDetelecineCustom = export.Task.CustomDetelecine;\r
-      \r
 \r
             // Video\r
             preset.VideoEncoder = EnumHelper<VideoEncoder>.GetShortName(export.Task.VideoEncoder);\r
@@ -631,7 +629,7 @@ namespace HandBrakeWPF.Services.Presets.Factories
             preset.VideoLevel = export.Task.VideoLevel != null ? export.Task.VideoLevel.ShortName : null;\r
             preset.VideoOptionExtra = export.Task.ExtraAdvancedArguments;\r
             preset.VideoPreset = export.Task.VideoPreset != null ? export.Task.VideoPreset.ShortName : null;\r
-            preset.VideoProfile = export.Task.VideoProfile != null ?  export.Task.VideoProfile.ShortName : null;\r
+            preset.VideoProfile = export.Task.VideoProfile != null ? export.Task.VideoProfile.ShortName : null;\r
             preset.VideoQSVAsyncDepth = 4; // Defaulted to 4 for now.\r
             preset.VideoQSVDecode = !config.DisableQuickSyncDecoding;\r
             preset.VideoQualitySlider = export.Task.Quality.HasValue ? export.Task.Quality.Value : 0;\r
index 04e2395ea9605cd3f06851968f0512da1cb42ffb..8b6aee917b03636a6e8e22386cafc4bd2651761d 100644 (file)
@@ -24,7 +24,7 @@ namespace HandBrakeWPF.Services.Presets.Model
     /// https://github.com/Caliburn-Micro/Caliburn.Micro/issues/89\r
     /// https://github.com/Caliburn-Micro/Caliburn.Micro/issues/96\r
     /// </remarks>\r
-    public class Preset : PropertyChangedBase  // Delibery not \r
+    public class Preset : PropertyChangedBase // Delibery not \r
     {\r
         #region Constants and Fields\r
 \r
index 5b2250f64d5dce0a357044ab6a4ac696bf652b73..64d2e6ec94d1d714008a013408fe0623c2c8e87d 100644 (file)
@@ -266,7 +266,7 @@ namespace HandBrakeWPF.Services.Queue
         {\r
             foreach (QueueTask job in this.queue)\r
             {\r
-                if (String.Equals(\r
+                if (string.Equals(\r
                     job.Task.Destination,\r
                     destination.Replace("\\\\", "\\"),\r
                     StringComparison.OrdinalIgnoreCase)\r
index 6a8885a071d3b6bc972ae67a37a42d5146da91b2..362df2e33bef8791b4afa2fe8fb9438284c01651 100644 (file)
@@ -15,15 +15,11 @@ namespace HandBrakeWPF.Services
     using System.Net;\r
     using System.Reflection;\r
     using System.Security.Cryptography;\r
-    using System.Text;\r
     using System.Threading;\r
-\r
-    using HandBrake.ApplicationServices.Utilities;\r
     using HandBrake.ApplicationServices.Interop;\r
-\r
+    using HandBrake.ApplicationServices.Utilities;\r
     using HandBrakeWPF.Model;\r
     using HandBrakeWPF.Services.Interfaces;\r
-\r
     using AppcastReader = HandBrakeWPF.Utilities.AppcastReader;\r
 \r
     /// <summary>\r
@@ -110,7 +106,7 @@ namespace HandBrakeWPF.Services
                         var currentBuild = HandBrakeUtils.Build;\r
 \r
                         // Fetch the Appcast from our server.\r
-                        HttpWebRequest request = (HttpWebRequest) WebRequest.Create(url);\r
+                        HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);\r
                         request.AllowAutoRedirect = false; // We will never do this.\r
                         WebResponse response = request.GetResponse();\r
 \r
@@ -196,7 +192,7 @@ namespace HandBrakeWPF.Services
                        while ((bytesSize = responceStream.Read(downBuffer, 0, downBuffer.Length)) > 0)\r
                        {\r
                            localStream.Write(downBuffer, 0, bytesSize);\r
-                           progress(new DownloadStatus { BytesRead = localStream.Length, TotalBytes = fileSize});\r
+                           progress(new DownloadStatus { BytesRead = localStream.Length, TotalBytes = fileSize });\r
                        }\r
 \r
                        responceStream.Close();\r
index df7f2a1a3a5fff2f4a57b8d2050573841666cd75..7a58721b31f485fc4f67338d9a60699cbe5449f1 100644 (file)
@@ -71,7 +71,7 @@ namespace HandBrakeWPF.Utilities
                 if (!Directory.Exists(dirPath))
                 {
                     MessageBoxResult result = errorService.ShowMessageBox(string.Format(Resources.DirectoryUtils_CreateFolderMsg, dirPath), Resources.DirectoryUtils_CreateFolder, MessageBoxButton.YesNo, MessageBoxImage.Question);
-                    if (MessageBoxResult.Yes == result)
+                    if (result == MessageBoxResult.Yes)
                     {
                         Directory.CreateDirectory(dirPath);
                     }
index f25b8be8e5cacaeaa31fa5b8ae5e6263276d1942..1379f432a1f731b37e3ab7d3b37a24eaf7c58ba7 100644 (file)
@@ -37,7 +37,9 @@ namespace HandBrakeWPF.Utilities
                 memberExpression = (MemberExpression)unaryExpression.Operand;
             }
             else
+            {
                 memberExpression = (MemberExpression)lambda.Body;
+            }
 
             return memberExpression.Member;
         }
index 18583acd86b2f667a4578e787b7660e42965a516..2492de8888bddcd3e1b6674242c119cab1c846f9 100644 (file)
@@ -107,15 +107,15 @@ namespace HandBrakeWPF.Utilities
                 gpuBuilder.Append("GPU Information is unavailable");
             }
 
-            logHeader.AppendLine(String.Format("HandBrake {0} - {1}", VersionHelper.GetVersion(), VersionHelper.GetPlatformBitnessVersion()));
-            logHeader.AppendLine(String.Format("OS: {0} - {1}", Environment.OSVersion, Environment.Is64BitOperatingSystem ? "64bit" : "32bit"));
-            logHeader.AppendLine(String.Format("CPU: {0}", SystemInfo.GetCpuCount));
-            logHeader.AppendLine(String.Format("Ram: {0} MB, ", SystemInfo.TotalPhysicalMemory));
-            logHeader.AppendLine(String.Format("GPU Information:{0}{1}", Environment.NewLine, gpuBuilder.ToString().TrimEnd()));
-            logHeader.AppendLine(String.Format("Screen: {0}x{1}", SystemInfo.ScreenBounds.Bounds.Width, SystemInfo.ScreenBounds.Bounds.Height));
-            logHeader.AppendLine(String.Format("Temp Dir: {0}", Path.GetTempPath()));
-            logHeader.AppendLine(String.Format("Install Dir: {0}", Application.StartupPath));
-            logHeader.AppendLine(String.Format("Data Dir: {0}\n", Application.UserAppDataPath));
+            logHeader.AppendLine(string.Format("HandBrake {0} - {1}", VersionHelper.GetVersion(), VersionHelper.GetPlatformBitnessVersion()));
+            logHeader.AppendLine(string.Format("OS: {0} - {1}", Environment.OSVersion, Environment.Is64BitOperatingSystem ? "64bit" : "32bit"));
+            logHeader.AppendLine(string.Format("CPU: {0}", SystemInfo.GetCpuCount));
+            logHeader.AppendLine(string.Format("Ram: {0} MB, ", SystemInfo.TotalPhysicalMemory));
+            logHeader.AppendLine(string.Format("GPU Information:{0}{1}", Environment.NewLine, gpuBuilder.ToString().TrimEnd()));
+            logHeader.AppendLine(string.Format("Screen: {0}x{1}", SystemInfo.ScreenBounds.Bounds.Width, SystemInfo.ScreenBounds.Bounds.Height));
+            logHeader.AppendLine(string.Format("Temp Dir: {0}", Path.GetTempPath()));
+            logHeader.AppendLine(string.Format("Install Dir: {0}", Application.StartupPath));
+            logHeader.AppendLine(string.Format("Data Dir: {0}\n", Application.UserAppDataPath));
 
             logHeader.AppendLine("-------------------------------------------");
 
index f9e2acee9e6a305cb3f3db9c071470452458f2aa..13a88ed44084f9467a8fa915444deba249e26f3d 100644 (file)
@@ -12,9 +12,8 @@ namespace HandBrakeWPF.Utilities.Input
 {
     using System;
     using System.Collections.Generic;
-    using System.Linq;
     using System.IO;
-
+    using System.Linq;
     using HandBrakeWPF.Helpers;
 
     /// <summary>
index 9b5981675ee228440c0d9a81d6608fb7341417fc..68eac79e235a42a4d032ad577b3ae9dc947941b3 100644 (file)
@@ -9,8 +9,8 @@
 
 namespace HandBrakeWPF.Utilities
 {
-    using System.Collections.Generic;
     using System;
+    using System.Collections.Generic;
     using System.IO;
 
     /// <summary>
index 9ed362e32e3525dd29337faa91a025a5d802fd00..f344cf3d64dc3bc2c45120e0506e95bd3fd5a0a2 100644 (file)
@@ -80,12 +80,12 @@ namespace HandBrakeWPF.Utilities
                     {
                         string gpu = string.Empty, version = string.Empty;
 
-                        foreach (PropertyData PC in share.Properties)
+                        foreach (PropertyData pc in share.Properties)
                         {
-                            if (!string.IsNullOrEmpty(PC.Name) && PC.Value != null)
+                            if (!string.IsNullOrEmpty(pc.Name) && pc.Value != null)
                             {
-                                if (PC.Name.Equals("DriverVersion")) version = PC.Value.ToString();
-                                if (PC.Name.Equals("Name")) gpu = PC.Value.ToString();
+                                if (pc.Name.Equals("DriverVersion")) version = pc.Value.ToString();
+                                if (pc.Name.Equals("Name")) gpu = pc.Value.ToString();
                             }
                         }
 
index 52877f61ffaeed3b124ba0b9c474b1b6f24e49d4..f8974a0c4287de6e2a4796360020a6de93538b8b 100644 (file)
@@ -86,7 +86,7 @@ namespace HandBrakeWPF.ViewModels
             this.errorService = errorService;\r
             this.windowManager = windowManager;\r
             this.Title = "Add Preset";\r
-            this.Preset = new Preset { IsBuildIn = false, IsDefault = false, Category = PresetService.UserPresetCatgoryName};\r
+            this.Preset = new Preset { IsBuildIn = false, IsDefault = false, Category = PresetService.UserPresetCatgoryName };\r
             this.PictureSettingsModes = EnumHelper<PresetPictureSettingsMode>.GetEnumList();\r
         }\r
 \r
index da65e2945da47ef2373bb82cf7f10363cf56b1b1..fcd1f22d92147248c8fa9d473d68914ce46f25c7 100644 (file)
@@ -12,9 +12,7 @@ namespace HandBrakeWPF.ViewModels
     using System;\r
     using System.Collections.Generic;\r
     using System.Collections.ObjectModel;\r
-    using System.ComponentModel.DataAnnotations;\r
     using System.IO;\r
-    using System.Text;\r
     using System.Linq;\r
     using System.Windows;\r
     using System.Windows.Forms;\r
@@ -32,7 +30,6 @@ namespace HandBrakeWPF.ViewModels
     using ChapterMarker = HandBrakeWPF.Services.Encode.Model.Models.ChapterMarker;\r
     using EncodeTask = HandBrakeWPF.Services.Encode.Model.EncodeTask;\r
     using GeneralApplicationException = HandBrakeWPF.Exceptions.GeneralApplicationException;\r
-    using MessageBox = System.Windows.Forms.MessageBox;\r
 \r
     /// <summary>\r
     /// The Chapters View Model\r
@@ -73,6 +70,7 @@ namespace HandBrakeWPF.ViewModels
         #endregion\r
 \r
         #region Public Properties\r
+\r
         /// <summary>\r
         /// Gets or sets Task.\r
         /// </summary>\r
@@ -209,9 +207,11 @@ namespace HandBrakeWPF.ViewModels
             if (!this.ValidateImportedChapters(importedChapters, out validationErrorMessage))\r
             {\r
                 if (!string.IsNullOrEmpty(validationErrorMessage))\r
+                {\r
                     throw new GeneralApplicationException(\r
                               Resources.ChaptersViewModel_ValidationFailedWarning,\r
                               validationErrorMessage);\r
+                }\r
 \r
                 // The user has cancelled the import, so exit\r
                 return;\r
@@ -234,55 +234,6 @@ namespace HandBrakeWPF.ViewModels
             }\r
         }\r
 \r
-        /// <summary>\r
-        /// Validates any imported chapter information against the currently detected chapter information in the \r
-        /// source media. If validation fails then an error message is returned via the out parameter <see cref="validationErrorMessage"/>\r
-        /// </summary>\r
-        /// <param name="importedChapters">The list of imported chapter information</param>\r
-        /// <param name="validationErrorMessage">In case of a validation error this variable will hold \r
-        ///                                      a detailed message that can be presented to the user</param>\r
-        /// <returns>True if there are no errors with imported chapters, false otherwise</returns>\r
-        private bool ValidateImportedChapters(Dictionary<int, Tuple<string, TimeSpan>> importedChapters, out string validationErrorMessage)\r
-        {\r
-            validationErrorMessage = null;\r
-\r
-            // If the number of chapters don't match, prompt for confirmation\r
-            if (importedChapters.Count != this.Task.ChapterNames.Count)\r
-            {\r
-                if (MessageBoxResult.Yes !=\r
-                    this.errorService.ShowMessageBox(\r
-                        string.Format(Resources.ChaptersViewModel_ValidateImportedChapters_ChapterCountMismatchMsg, this.Task.ChapterNames.Count, importedChapters.Count),\r
-                        Resources.ChaptersViewModel_ValidateImportedChapters_ChapterCountMismatchWarning,\r
-                        MessageBoxButton.YesNo,\r
-                        MessageBoxImage.Question))\r
-                {\r
-                    return false;\r
-                }\r
-            }\r
-\r
-            // If the average discrepancy in timings between chapters is either:\r
-            //   a) more than 15 sec for more than 2 chapters\r
-            //      (I chose 15sec based on empirical evidence from testing a few DVDs and comparing to chapter-marker files I downloaded)\r
-            //      => This check will not be performed for the first and last chapter as they're very likely to differ significantly due to language and region\r
-            //         differences (e.g. longer title sequences and different distributor credits)\r
-            var diffs = importedChapters.Zip(this.Task.ChapterNames, (import, source) => source.Duration - import.Value.Item2);\r
-            if (diffs.Count(diff => Math.Abs(diff.TotalSeconds) > 15) > 2)\r
-            {\r
-                if (MessageBoxResult.Yes !=\r
-                    this.errorService.ShowMessageBox(\r
-                        Resources.ChaptersViewModel_ValidateImportedChapters_ChapterDurationMismatchMsg,\r
-                        Resources.ChaptersViewModel_ValidateImportedChapters_ChapterDurationMismatchWarning,\r
-                        MessageBoxButton.YesNo,\r
-                        MessageBoxImage.Question))\r
-                {\r
-                    return false;\r
-                }\r
-            }\r
-\r
-            // All is well, we should import chapters\r
-            return true;\r
-        }\r
-\r
         /// <summary>\r
         /// Setup this window for a new source\r
         /// </summary>\r
@@ -379,5 +330,58 @@ namespace HandBrakeWPF.ViewModels
         }\r
 \r
         #endregion\r
+\r
+        #region Private Methods\r
+\r
+        /// <summary>\r
+        /// Validates any imported chapter information against the currently detected chapter information in the \r
+        /// source media. If validation fails then an error message is returned via the out parameter <see cref="validationErrorMessage"/>\r
+        /// </summary>\r
+        /// <param name="importedChapters">The list of imported chapter information</param>\r
+        /// <param name="validationErrorMessage">In case of a validation error this variable will hold \r
+        ///                                      a detailed message that can be presented to the user</param>\r
+        /// <returns>True if there are no errors with imported chapters, false otherwise</returns>\r
+        private bool ValidateImportedChapters(Dictionary<int, Tuple<string, TimeSpan>> importedChapters, out string validationErrorMessage)\r
+        {\r
+            validationErrorMessage = null;\r
+\r
+            // If the number of chapters don't match, prompt for confirmation\r
+            if (importedChapters.Count != this.Task.ChapterNames.Count)\r
+            {\r
+                if (this.errorService.ShowMessageBox(\r
+                        string.Format(Resources.ChaptersViewModel_ValidateImportedChapters_ChapterCountMismatchMsg, this.Task.ChapterNames.Count, importedChapters.Count),\r
+                        Resources.ChaptersViewModel_ValidateImportedChapters_ChapterCountMismatchWarning,\r
+                        MessageBoxButton.YesNo,\r
+                        MessageBoxImage.Question) !=\r
+                    MessageBoxResult.Yes)\r
+                {\r
+                    return false;\r
+                }\r
+            }\r
+\r
+            // If the average discrepancy in timings between chapters is either:\r
+            //   a) more than 15 sec for more than 2 chapters\r
+            //      (I chose 15sec based on empirical evidence from testing a few DVDs and comparing to chapter-marker files I downloaded)\r
+            //      => This check will not be performed for the first and last chapter as they're very likely to differ significantly due to language and region\r
+            //         differences (e.g. longer title sequences and different distributor credits)\r
+            var diffs = importedChapters.Zip(this.Task.ChapterNames, (import, source) => source.Duration - import.Value.Item2);\r
+            if (diffs.Count(diff => Math.Abs(diff.TotalSeconds) > 15) > 2)\r
+            {\r
+                if (this.errorService.ShowMessageBox(\r
+                        Resources.ChaptersViewModel_ValidateImportedChapters_ChapterDurationMismatchMsg,\r
+                        Resources.ChaptersViewModel_ValidateImportedChapters_ChapterDurationMismatchWarning,\r
+                        MessageBoxButton.YesNo,\r
+                        MessageBoxImage.Question) !=\r
+                    MessageBoxResult.Yes)\r
+                {\r
+                    return false;\r
+                }\r
+            }\r
+\r
+            // All is well, we should import chapters\r
+            return true;\r
+        }\r
+\r
+        #endregion\r
     }\r
 }
\ No newline at end of file
index 5b671c23db3562a1f4db0b491289a2770d7ec35c..db7c608ff08b8cde64a29da8a2f4efa5a1100737 100644 (file)
@@ -1857,7 +1857,7 @@ namespace HandBrakeWPF.ViewModels
                                 Resources.DirectoryUtils_CreateFolder,\r
                                 MessageBoxButton.YesNo,\r
                                 MessageBoxImage.Question);\r
-                        if (MessageBoxResult.Yes == result)\r
+                        if (result == MessageBoxResult.Yes)\r
                         {\r
                             Directory.CreateDirectory(directory);\r
                             Process.Start(directory);\r
@@ -2437,7 +2437,7 @@ namespace HandBrakeWPF.ViewModels
         /// <param name="e">\r
         /// The e.\r
         /// </param>\r
-        void QueueProcessorJobProcessingStarted(object sender, QueueProgressEventArgs e)\r
+        private void QueueProcessorJobProcessingStarted(object sender, QueueProgressEventArgs e)\r
         {\r
             Execute.OnUIThread(\r
                () =>\r
@@ -2547,7 +2547,6 @@ namespace HandBrakeWPF.ViewModels
                     this.QueueViewModel.WhenDone(this.userSettingService.GetUserSetting<string>(UserSettingConstants.WhenCompleteAction), false);\r
                     break;\r
             }\r
-\r
         }\r
 \r
         /// <summary>\r
index 7f0fed5b629895bd3f41f9110ffdfe690bcdeffc..42b9f4bab54d76289beb6c061e290c02d8f277d1 100644 (file)
@@ -48,7 +48,7 @@ namespace HandBrakeWPF.ViewModels
             this.errorService = errorService;
             this.windowManager = windowManager;
             this.Title = "Manage Preset";
-            this.Preset = new Preset { IsBuildIn = false, IsDefault = false, Category = PresetService.UserPresetCatgoryName};
+            this.Preset = new Preset { IsBuildIn = false, IsDefault = false, Category = PresetService.UserPresetCatgoryName };
         }
 
         /// <summary>
index 7322e3060e4195101ccefc0226029639f0a50828..17154f92273e232be01bedafbc10b486c1fa58cd 100644 (file)
@@ -494,6 +494,7 @@ namespace HandBrakeWPF.ViewModels
         #endregion\r
 \r
         #region Preview\r
+\r
         /// <summary>\r
         /// Gets or sets VLCPath.\r
         /// </summary>\r
@@ -510,6 +511,7 @@ namespace HandBrakeWPF.ViewModels
                 this.NotifyOfPropertyChange("VLCPath");\r
             }\r
         }\r
+\r
         #endregion\r
 \r
         #region System and Logging\r
@@ -1315,7 +1317,6 @@ namespace HandBrakeWPF.ViewModels
 \r
             // Use dvdnav\r
             this.DisableLibdvdNav = userSettingService.GetUserSetting<bool>(UserSettingConstants.DisableLibDvdNav);\r
-\r
         }\r
 \r
         /// <summary>\r
@@ -1326,6 +1327,17 @@ namespace HandBrakeWPF.ViewModels
             this.WhenDone = userSettingService.GetUserSetting<string>("WhenCompleteAction");\r
         }\r
 \r
+        /// <summary>\r
+        /// The goto tab.\r
+        /// </summary>\r
+        /// <param name="tab">\r
+        /// The tab.\r
+        /// </param>\r
+        public void GotoTab(OptionsTab tab)\r
+        {\r
+            this.SelectedTab = tab;\r
+        }\r
+\r
         /// <summary>\r
         /// Save the settings selected\r
         /// </summary>\r
@@ -1451,17 +1463,6 @@ namespace HandBrakeWPF.ViewModels
             }\r
         }\r
 \r
-        /// <summary>\r
-        /// The goto tab.\r
-        /// </summary>\r
-        /// <param name="tab">\r
-        /// The tab.\r
-        /// </param>\r
-        public void GotoTab(OptionsTab tab)\r
-        {\r
-            this.SelectedTab = tab;\r
-        }\r
-\r
         /// <summary>\r
         /// Validate the Autoname Fileformat string\r
         /// </summary>\r
index a428144c0fa9ea6c2f541fb828dfb3dae3387493..a28fa889b216bdaf7a922315fee852167c82244c 100644 (file)
@@ -788,8 +788,9 @@ namespace HandBrakeWPF.ViewModels
                     this.Task.Height = this.GetModulusValue(this.sourceResolution.Height - this.CropTop - this.CropBottom);\r
                     this.MaintainAspectRatio = preset.Task.KeepDisplayAspect;\r
                 }\r
-                else // Custom\r
+                else \r
                 {\r
+                    // Custom\r
                     // Set the Width, and Maintain Aspect ratio. That should calc the Height for us.\r
                     this.Task.Width = this.GetModulusValue(this.MaxWidth - this.CropLeft - this.CropRight);\r
 \r
@@ -1063,7 +1064,7 @@ namespace HandBrakeWPF.ViewModels
     /// <summary>\r
     /// The changed picture field.\r
     /// </summary>\r
-    enum ChangedPictureField\r
+    public enum ChangedPictureField\r
     {\r
         Width,\r
         Height,\r
index 97811dec9ab9bc89b5d5e29ad9a0f671d605a651..c5351d7299a04a91bbbde8c5702795616460d160 100644 (file)
@@ -459,7 +459,6 @@ namespace HandBrakeWPF.ViewModels
             this.queueProcessor.QueueCompleted += this.queueProcessor_QueueCompleted;\r
             this.queueProcessor.QueueChanged += this.QueueManager_QueueChanged;\r
             this.queueProcessor.JobProcessingStarted += this.QueueProcessorJobProcessingStarted;\r
-\r
         }\r
 \r
         public void Deactivate()\r
index fdc2886c7d9fb6370ea2b0a71ce2ac8097ee50af..55045cbca9a0f6d3eb4fe940e8962f7a1de2cb55 100644 (file)
@@ -591,7 +591,7 @@ namespace HandBrakeWPF.ViewModels
                             // Attempt to find VLC if it doesn't exist in the default set location.\r
                             string vlcPath;\r
 \r
-                            if (IntPtr.Size == 8 || (!String.IsNullOrEmpty(Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432"))))\r
+                            if (IntPtr.Size == 8 || (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432"))))\r
                                 vlcPath = Environment.GetEnvironmentVariable("ProgramFiles(x86)");\r
                             else\r
                                 vlcPath = Environment.GetEnvironmentVariable("ProgramFiles");\r
index 826805636df4739a3ba19408685c4180c5b06e2a..d38883b44e1370c9f662e5f1cce0227b937a2c1a 100644 (file)
@@ -198,7 +198,7 @@ namespace HandBrakeWPF.ViewModels
         /// <summary>\r
         /// The add first for selected languages.\r
         /// </summary>\r
-        private void AddFirstForSelectedLanguages()\r
+        public void AddFirstForSelectedLanguages()\r
         {\r
             foreach (Subtitle sourceTrack in this.GetSelectedLanguagesTracks())\r
             {\r
@@ -372,7 +372,8 @@ namespace HandBrakeWPF.ViewModels
                     case SubtitleBurnInBehaviourModes.FirstTrack:                    \r
                         foreach (var track in this.Task.SubtitleTracks)\r
                         {\r
-                            if (track.SourceTrack.SubtitleType == SubtitleType.ForeignAudioSearch) // Foreign Audio Search is always first in the list.\r
+                            // Foreign Audio Search is always first in the list.\r
+                            if (track.SourceTrack.SubtitleType == SubtitleType.ForeignAudioSearch) \r
                             {\r
                                 track.Forced = true;\r
                                 continue;\r
index 32f0b8dbda63f6b845e2955782073a63658d48d4..d3da0f1c0b2f6ba5c72bca83be0627d68400c4e1 100644 (file)
@@ -337,7 +337,7 @@ namespace HandBrakeWPF.ViewModels
                     case VideoEncoder.X265_10:\r
                     case VideoEncoder.X265_12:\r
                         double cqStep = userSettingService.GetUserSetting<double>(UserSettingConstants.X264Step);\r
-                        double rfValue = 51.0 - value * cqStep;\r
+                        double rfValue = 51.0 - (value * cqStep);\r
                         rfValue = Math.Round(rfValue, 2);\r
                         this.Task.Quality = rfValue;\r
                         break;           \r
@@ -714,7 +714,7 @@ namespace HandBrakeWPF.ViewModels
                 if (encoder != null)\r
                 {\r
                     string preset = value >= 0 ? encoder.Presets[value] : null;\r
-                    this.VideoPreset = preset != null ?new VideoPreset(preset, preset) : this.VideoPresets.FirstOrDefault();\r
+                    this.VideoPreset = preset != null ? new VideoPreset(preset, preset) : this.VideoPresets.FirstOrDefault();\r
                 }\r
 \r
                 this.NotifyOfPropertyChange(() => this.VideoPresetValue);\r
@@ -1062,7 +1062,6 @@ namespace HandBrakeWPF.ViewModels
             }\r
         }\r
 \r
-\r
         /// <summary>\r
         /// The get actualx 264 query.\r
         /// </summary>\r