]> granicus.if.org Git - handbrake/commitdiff
WinGui: Fix a number of stylecop warnings.
authorsr55 <sr55.hb@outlook.com>
Sun, 26 Mar 2017 10:57:57 +0000 (11:57 +0100)
committersr55 <sr55.hb@outlook.com>
Sun, 26 Mar 2017 10:57:57 +0000 (11:57 +0100)
26 files changed:
win/CS/HandBrakeWPF/Controls/SplitButton/SplitMenuButton.cs
win/CS/HandBrakeWPF/Converters/FullPathToFileNameConverter.cs
win/CS/HandBrakeWPF/Converters/Options/OptionsTabConverter.cs
win/CS/HandBrakeWPF/Converters/QueueStatusToVisibilityConverter.cs
win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs
win/CS/HandBrakeWPF/Services/Encode/EncodeBase.cs
win/CS/HandBrakeWPF/Services/Encode/LibEncode.cs
win/CS/HandBrakeWPF/Services/Encode/Model/Models/Video/VideoLevel.cs
win/CS/HandBrakeWPF/Services/Encode/Model/Models/Video/VideoPreset.cs
win/CS/HandBrakeWPF/Services/Encode/Model/Models/Video/VideoProfile.cs
win/CS/HandBrakeWPF/Services/Encode/Model/Models/Video/VideoTune.cs
win/CS/HandBrakeWPF/Services/Presets/Model/Preset.cs
win/CS/HandBrakeWPF/Services/Presets/Model/PresetDisplayCategory.cs
win/CS/HandBrakeWPF/Services/Presets/PresetService.cs
win/CS/HandBrakeWPF/Services/Queue/Model/QueueTask.cs
win/CS/HandBrakeWPF/Services/Queue/QueueProcessor.cs
win/CS/HandBrakeWPF/Services/Scan/LibScan.cs
win/CS/HandBrakeWPF/Services/UserSettingService.cs
win/CS/HandBrakeWPF/Utilities/Execute.cs
win/CS/HandBrakeWPF/Utilities/PropertyChangedBase.cs
win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs
win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
win/CS/HandBrakeWPF/Views/ShellView.xaml.cs

index adf17eb46eb3e056a28a350ff31770bc92306274..fb05bc967d9a57a9af9b6c56ec6b6af496a06b14 100644 (file)
@@ -36,7 +36,7 @@ namespace HandBrakeWPF.Controls.SplitButton
         /// <summary>\r
         /// The is mouse over split element.\r
         /// </summary>\r
-        private bool IsMouseOverSplitElement;\r
+        private bool isMouseOverSplitElement;\r
 \r
         /// <summary>\r
         /// The context menu.\r
@@ -156,7 +156,7 @@ namespace HandBrakeWPF.Controls.SplitButton
         /// </summary>\r
         protected override void OnClick()\r
         {\r
-            if (this.IsMouseOverSplitElement)\r
+            if (this.isMouseOverSplitElement)\r
             {\r
                 this.OpenButtonMenu();\r
             }\r
@@ -259,7 +259,7 @@ namespace HandBrakeWPF.Controls.SplitButton
         /// </param>\r
         private void SplitElement_MouseEnter(object sender, MouseEventArgs e)\r
         {\r
-            this.IsMouseOverSplitElement = true;\r
+            this.isMouseOverSplitElement = true;\r
         }\r
 \r
         /// <summary>\r
@@ -273,7 +273,7 @@ namespace HandBrakeWPF.Controls.SplitButton
         /// </param>\r
         private void SplitElement_MouseLeave(object sender, MouseEventArgs e)\r
         {\r
-            this.IsMouseOverSplitElement = false;\r
+            this.isMouseOverSplitElement = false;\r
         }\r
 \r
         /// <summary>\r
index 7989d6b06b10a9eb3753de70dc713d105a0777d0..4fa4b209c4c7495fa8be0709bd7b120c73322746 100644 (file)
@@ -9,10 +9,10 @@
 \r
 namespace HandBrakeWPF.Converters\r
 {\r
+    using System;\r
     using System.Globalization;\r
     using System.IO;\r
     using System.Windows.Data;\r
-    using System;\r
 \r
     /// <summary>\r
     /// Converts a Full Path to Filename only.\r
index 54897e19c8d5635f4001877f011316b8ef006c3f..c7837efd491747b736b2af3d028980583ddc8b94 100644 (file)
@@ -19,7 +19,7 @@ namespace HandBrakeWPF.Converters.Options
     /// <summary>\r
     /// The Options Tab Converter. Controls which tab is dispalyed.\r
     /// </summary>\r
-    class OptionsTabConverter : IValueConverter\r
+    public class OptionsTabConverter : IValueConverter\r
     {\r
         /// <summary>\r
         /// Converts a value. \r
index f882728e728029ca5437a67ce718c04e4538c1c8..c5691b2c5edeb535e2e8c5e567973e3a32963e92 100644 (file)
@@ -9,11 +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
     using HandBrakeWPF.Services.Queue.Model;\r
 \r
     /// <summary>\r
index 01dd64667bc66bdd3126ead5f27d02c5538a366d..83494ee36811e073a8d4987b19810a8a94e659a7 100644 (file)
@@ -56,14 +56,14 @@ namespace HandBrakeWPF.Helpers
                 }\r
 \r
                 List<string> removeFiles = new List<string>();\r
-                XmlSerializer Ser = new XmlSerializer(typeof(List<QueueTask>));\r
+                XmlSerializer ser = new XmlSerializer(typeof(List<QueueTask>));\r
                 foreach (FileInfo file in logFiles)\r
                 {\r
                     try\r
                     {\r
                         using (FileStream strm = new FileStream(file.FullName, FileMode.Open, FileAccess.Read))\r
                         {\r
-                            List<QueueTask> list = Ser.Deserialize(strm) as List<QueueTask>;\r
+                            List<QueueTask> list = ser.Deserialize(strm) as List<QueueTask>;\r
                             if (list != null && list.Count == 0)\r
                             {\r
                                 removeFiles.Add(file.FullName);\r
index 0e84c3650e7240c7013c3aeef16518677fdf0b7e..8f7dee945aedc1aa31c7ce075375ed0ac9705912 100644 (file)
@@ -170,53 +170,53 @@ namespace HandBrakeWPF.Services.Encode
         }
 
         /// <summary>
-        /// The write file.
+        /// Verify the Encode Destination path exists and if not, create it.
         /// </summary>
-        /// <param name="content">
-        /// The content.
-        /// </param>
-        /// <param name="fileName">
-        /// The file name.
+        /// <param name="task">
+        /// The task.
         /// </param>
-        private void WriteFile(string content, string fileName)
+        /// <exception cref="Exception">
+        /// If the creation fails, an exception is thrown.
+        /// </exception>
+        protected void VerifyEncodeDestinationPath(EncodeTask task)
         {
+            // Make sure the path exists, attempt to create it if it doesn't
             try
             {
-                using (StreamWriter fileWriter = new StreamWriter(fileName) { AutoFlush = true })
+                string path = Directory.GetParent(task.Destination).ToString();
+                if (!Directory.Exists(path))
                 {
-                    fileWriter.Write(content);
+                    Directory.CreateDirectory(path);
                 }
             }
             catch (Exception exc)
             {
-                Debug.WriteLine(exc);
+                throw new GeneralApplicationException(
+                    "Unable to create directory for the encoded output.", "Please verify that you have a valid path.", exc);
             }
         }
 
         /// <summary>
-        /// Verify the Encode Destination path exists and if not, create it.
+        /// The write file.
         /// </summary>
-        /// <param name="task">
-        /// The task.
+        /// <param name="content">
+        /// The content.
         /// </param>
-        /// <exception cref="Exception">
-        /// If the creation fails, an exception is thrown.
-        /// </exception>
-        protected void VerifyEncodeDestinationPath(EncodeTask task)
+        /// <param name="fileName">
+        /// The file name.
+        /// </param>
+        private void WriteFile(string content, string fileName)
         {
-            // Make sure the path exists, attempt to create it if it doesn't
             try
             {
-                string path = Directory.GetParent(task.Destination).ToString();
-                if (!Directory.Exists(path))
+                using (StreamWriter fileWriter = new StreamWriter(fileName) { AutoFlush = true })
                 {
-                    Directory.CreateDirectory(path);
+                    fileWriter.Write(content);
                 }
             }
             catch (Exception exc)
             {
-                throw new GeneralApplicationException(
-                    "Unable to create directory for the encoded output.", "Please verify that you have a valid path.", exc);
+                Debug.WriteLine(exc);
             }
         }
 
index d8f25373abc52021765cb5619992d4bad6ebdc36..03763d448388e93d74f74839aad40c08562ae90b 100644 (file)
@@ -151,6 +151,15 @@ namespace HandBrakeWPF.Services.Encode
 
         #region HandBrakeInstance Event Handlers.
 
+        /// <summary>
+        /// Service Log Message.
+        /// </summary>
+        /// <param name="message">Log message content</param>
+        protected void ServiceLogMessage(string message)
+        {
+            this.log.LogMessage(string.Format("{0}# {1}{0}", Environment.NewLine, message), LogMessageType.ScanOrEncode, LogLevel.Info);
+        }
+
         /// <summary>
         /// Encode Progress Event Handler
         /// </summary>
@@ -200,15 +209,6 @@ namespace HandBrakeWPF.Services.Encode
                     ? new EventArgs.EncodeCompletedEventArgs(false, null, string.Empty, this.currentTask.Destination)
                     : new EventArgs.EncodeCompletedEventArgs(true, null, string.Empty, this.currentTask.Destination));
         }
-
-        /// <summary>
-        /// Service Log Message.
-        /// </summary>
-        /// <param name="message">Log message content</param>
-        protected void ServiceLogMessage(string message)
-        {
-            this.log.LogMessage(string.Format("{0}# {1}{0}", Environment.NewLine, message), LogMessageType.ScanOrEncode, LogLevel.Info);
-        }
         #endregion
     }
 }
index e7ca53e06219e661c93f946fdbd81de1bc5cd6c4..4cf6724a3b17cac4b1f6f7185bbab3dbf6b2f374 100644 (file)
@@ -64,20 +64,6 @@ namespace HandBrakeWPF.Services.Encode.Model.Models.Video
             return new VideoLevel(this.DisplayName, this.ShortName);
         }
 
-        /// <summary>
-        /// The equals.
-        /// </summary>
-        /// <param name="other">
-        /// The other.
-        /// </param>
-        /// <returns>
-        /// The <see cref="bool"/>.
-        /// </returns>
-        protected bool Equals(VideoLevel other)
-        {
-            return string.Equals(this.ShortName, other.ShortName);
-        }
-
         /// <summary>
         /// The equals.
         /// </summary>
@@ -114,5 +100,19 @@ namespace HandBrakeWPF.Services.Encode.Model.Models.Video
         {
             return (this.ShortName != null ? this.ShortName.GetHashCode() : 0);
         }
+
+        /// <summary>
+        /// The equals.
+        /// </summary>
+        /// <param name="other">
+        /// The other.
+        /// </param>
+        /// <returns>
+        /// The <see cref="bool"/>.
+        /// </returns>
+        protected bool Equals(VideoLevel other)
+        {
+            return string.Equals(this.ShortName, other.ShortName);
+        }
     }
 }
index 8efdf5b58cc8f2d295dcb2f9c499003d21ff02dd..887540c318358d61c7b0fe79aa04735fd21d92ce 100644 (file)
@@ -64,20 +64,6 @@ namespace HandBrakeWPF.Services.Encode.Model.Models.Video
             return new VideoPreset(this.DisplayName, this.ShortName);
         }
 
-        /// <summary>
-        /// The equals.
-        /// </summary>
-        /// <param name="other">
-        /// The other.
-        /// </param>
-        /// <returns>
-        /// The <see cref="bool"/>.
-        /// </returns>
-        protected bool Equals(VideoPreset other)
-        {
-            return string.Equals(this.ShortName, other.ShortName);
-        }
-
         /// <summary>
         /// The equals.
         /// </summary>
@@ -117,5 +103,19 @@ namespace HandBrakeWPF.Services.Encode.Model.Models.Video
         {
             return (this.ShortName != null ? this.ShortName.GetHashCode() : 0);
         }
+
+        /// <summary>
+        /// The equals.
+        /// </summary>
+        /// <param name="other">
+        /// The other.
+        /// </param>
+        /// <returns>
+        /// The <see cref="bool"/>.
+        /// </returns>
+        protected bool Equals(VideoPreset other)
+        {
+            return string.Equals(this.ShortName, other.ShortName);
+        }
     }
 }
index 80d3fe26d0544a539dbbfb3d5c932a4256ef7315..4091e4cfb0683a34716a5239d774776d9d6d2ce7 100644 (file)
@@ -64,20 +64,6 @@ namespace HandBrakeWPF.Services.Encode.Model.Models.Video
             return new VideoProfile(this.DisplayName, this.ShortName);
         }
 
-        /// <summary>
-        /// The equals.
-        /// </summary>
-        /// <param name="other">
-        /// The other.
-        /// </param>
-        /// <returns>
-        /// The <see cref="bool"/>.
-        /// </returns>
-        protected bool Equals(VideoProfile other)
-        {
-            return string.Equals(this.DisplayName, other.DisplayName) && string.Equals(this.ShortName, other.ShortName);
-        }
-
         /// <summary>
         /// The equals.
         /// </summary>
@@ -117,5 +103,19 @@ namespace HandBrakeWPF.Services.Encode.Model.Models.Video
                 return ((this.DisplayName != null ? this.DisplayName.GetHashCode() : 0) * 397) ^ (this.ShortName != null ? this.ShortName.GetHashCode() : 0);
             }
         }
+
+        /// <summary>
+        /// The equals.
+        /// </summary>
+        /// <param name="other">
+        /// The other.
+        /// </param>
+        /// <returns>
+        /// The <see cref="bool"/>.
+        /// </returns>
+        protected bool Equals(VideoProfile other)
+        {
+            return string.Equals(this.DisplayName, other.DisplayName) && string.Equals(this.ShortName, other.ShortName);
+        }
     }
 }
index deba2a56ffa9eea4135dcc320fd252fbd7a70290..d202cf51dcd63db26ada7ad9d63a44653fe5e871 100644 (file)
@@ -69,34 +69,6 @@ namespace HandBrakeWPF.Services.Encode.Model.Models.Video
             return new VideoTune(this.DisplayName, this.ShortName);
         }
 
-        /// <summary>
-        /// The equals.
-        /// </summary>
-        /// <param name="other">
-        /// The other.
-        /// </param>
-        /// <returns>
-        /// The <see cref="bool"/>.
-        /// </returns>
-        protected bool Equals(HandBrakeWPF.Services.Encode.Model.Models.Video.VideoProfile other)
-        {
-            return string.Equals(this.DisplayName, other.DisplayName) && string.Equals(this.ShortName, other.ShortName);
-        }
-
-        /// <summary>
-        /// The equals.
-        /// </summary>
-        /// <param name="other">
-        /// The other.
-        /// </param>
-        /// <returns>
-        /// The <see cref="bool"/>.
-        /// </returns>
-        protected bool Equals(VideoTune other)
-        {
-            return string.Equals(this.ShortName, other.ShortName);
-        }
-
         /// <summary>
         /// The equals.
         /// </summary>
@@ -133,5 +105,33 @@ namespace HandBrakeWPF.Services.Encode.Model.Models.Video
         {
             return (this.ShortName != null ? this.ShortName.GetHashCode() : 0);
         }
+
+        /// <summary>
+        /// The equals.
+        /// </summary>
+        /// <param name="other">
+        /// The other.
+        /// </param>
+        /// <returns>
+        /// The <see cref="bool"/>.
+        /// </returns>
+        protected bool Equals(VideoTune other)
+        {
+            return string.Equals(this.ShortName, other.ShortName);
+        }
+
+        /// <summary>
+        /// The equals.
+        /// </summary>
+        /// <param name="other">
+        /// The other.
+        /// </param>
+        /// <returns>
+        /// The <see cref="bool"/>.
+        /// </returns>
+        protected bool Equals(VideoProfile other)
+        {
+            return string.Equals(this.DisplayName, other.DisplayName) && string.Equals(this.ShortName, other.ShortName);
+        }
     }
 }
index 5f179f67e3352583fb977dd959d23f50ee71c578..8c0ff34c890f6e031591e8cd56a536e677cf4908 100644 (file)
@@ -185,20 +185,6 @@ namespace HandBrakeWPF.Services.Presets.Model
 \r
         #endregion\r
 \r
-        /// <summary>\r
-        /// The equals.\r
-        /// </summary>\r
-        /// <param name="other">\r
-        /// The other.\r
-        /// </param>\r
-        /// <returns>\r
-        /// The <see cref="bool"/>.\r
-        /// </returns>\r
-        protected bool Equals(Preset other)\r
-        {\r
-            return string.Equals(this.Name, other.Name);\r
-        }\r
-\r
         /// <summary>\r
         /// The equals.\r
         /// </summary>\r
@@ -235,5 +221,19 @@ namespace HandBrakeWPF.Services.Presets.Model
         {\r
             return (this.Name != null ? this.Name.GetHashCode() : 0);\r
         }\r
+\r
+        /// <summary>\r
+        /// The equals.\r
+        /// </summary>\r
+        /// <param name="other">\r
+        /// The other.\r
+        /// </param>\r
+        /// <returns>\r
+        /// The <see cref="bool"/>.\r
+        /// </returns>\r
+        protected bool Equals(Preset other)\r
+        {\r
+            return string.Equals(this.Name, other.Name);\r
+        }\r
     }\r
 }
\ No newline at end of file
index 95d2213fb5186219ec01331fee573e142948daa8..f70fd4680092022cbd57ca36f1514b764361852b 100644 (file)
@@ -57,11 +57,6 @@ namespace HandBrakeWPF.Services.Presets.Model
             }
         }
 
-        protected bool Equals(PresetDisplayCategory other)
-        {
-            return string.Equals(this.Category, other.Category);
-        }
-
         public override bool Equals(object obj)
         {
             if (ReferenceEquals(null, obj)) return false;
@@ -74,5 +69,10 @@ namespace HandBrakeWPF.Services.Presets.Model
         {
             return (this.Category != null ? this.Category.GetHashCode() : 0);
         }
+
+        protected bool Equals(PresetDisplayCategory other)
+        {
+            return string.Equals(this.Category, other.Category);
+        }
     }
 }
index a90bf1543c8cd7c02e46c16580d36c5dd7536887..61e051fcd30e8793c80d8b2b0577da56704d1d5d 100644 (file)
@@ -816,8 +816,10 @@ namespace HandBrakeWPF.Services.Presets
 \r
                 // Orgamise the Presets list into Json Equivilent objects.\r
                 Dictionary<string, PresetCategory> presetCategories = new Dictionary<string, PresetCategory>();\r
-                List<HBPreset> uncategorisedPresets = new List<HBPreset>();      \r
-                foreach (Preset item in this.flatPresetList.Values.OrderBy(o => o.IsBuildIn)) // Handle User Presets first.\r
+                List<HBPreset> uncategorisedPresets = new List<HBPreset>();\r
+\r
+                // Handle User Presets first.\r
+                foreach (Preset item in this.flatPresetList.Values.OrderBy(o => o.IsBuildIn))\r
                 {\r
                     if (string.IsNullOrEmpty(item.Category))\r
                     {\r
index 572300dd62ff51167f89668d54bf13eba7a9bd0a..ac1b28d943ab691aa848cbc3db6971393407e0a9 100644 (file)
@@ -93,20 +93,6 @@ namespace HandBrakeWPF.Services.Queue.Model
 \r
         #endregion\r
 \r
-        /// <summary>\r
-        /// The equals.\r
-        /// </summary>\r
-        /// <param name="other">\r
-        /// The other.\r
-        /// </param>\r
-        /// <returns>\r
-        /// The <see cref="bool"/>.\r
-        /// </returns>\r
-        protected bool Equals(QueueTask other)\r
-        {\r
-            return Equals(this.ScannedSourcePath, other.ScannedSourcePath) && Equals(this.Task, other.Task) && this.status == other.status;\r
-        }\r
-\r
         /// <summary>\r
         /// The equals.\r
         /// </summary>\r
@@ -152,5 +138,19 @@ namespace HandBrakeWPF.Services.Queue.Model
                 return hashCode;\r
             }\r
         }\r
+\r
+        /// <summary>\r
+        /// The equals.\r
+        /// </summary>\r
+        /// <param name="other">\r
+        /// The other.\r
+        /// </param>\r
+        /// <returns>\r
+        /// The <see cref="bool"/>.\r
+        /// </returns>\r
+        protected bool Equals(QueueTask other)\r
+        {\r
+            return Equals(this.ScannedSourcePath, other.ScannedSourcePath) && Equals(this.Task, other.Task) && this.status == other.status;\r
+        }\r
     }\r
 }
\ No newline at end of file
index 02a378da7e7daae8af11defcdc9ffadca54585e5..f7e38d5e04938ba90e6d1f9541e93959ddafbb18 100644 (file)
@@ -519,6 +519,31 @@ namespace HandBrakeWPF.Services.Queue
 \r
         #region Methods\r
 \r
+        /// <summary>\r
+        /// The on queue completed.\r
+        /// </summary>\r
+        /// <param name="e">\r
+        /// The e.\r
+        /// </param>\r
+        protected virtual void OnQueueCompleted(QueueCompletedEventArgs e)\r
+        {\r
+            QueueCompletedEventDelegate handler = this.QueueCompleted;\r
+            if (handler != null)\r
+            {\r
+                handler(this, e);\r
+            }\r
+\r
+            this.IsProcessing = false;\r
+        }\r
+\r
+        /// <summary>\r
+        /// The on low diskspace detected.\r
+        /// </summary>\r
+        protected virtual void OnLowDiskspaceDetected()\r
+        {\r
+            this.LowDiskspaceDetected?.Invoke(this, EventArgs.Empty);\r
+        }\r
+\r
         /// <summary>\r
         /// After an encode is complete, move onto the next job.\r
         /// </summary>\r
@@ -611,31 +636,6 @@ namespace HandBrakeWPF.Services.Queue
                 handler(this, e);\r
             }\r
         }\r
-\r
-        /// <summary>\r
-        /// The on queue completed.\r
-        /// </summary>\r
-        /// <param name="e">\r
-        /// The e.\r
-        /// </param>\r
-        protected virtual void OnQueueCompleted(QueueCompletedEventArgs e)\r
-        {\r
-            QueueCompletedEventDelegate handler = this.QueueCompleted;\r
-            if (handler != null)\r
-            {\r
-                handler(this, e);\r
-            }\r
-\r
-            this.IsProcessing = false;\r
-        }\r
-\r
-        /// <summary>\r
-        /// The on low diskspace detected.\r
-        /// </summary>\r
-        protected virtual void OnLowDiskspaceDetected()\r
-        {\r
-            this.LowDiskspaceDetected?.Invoke(this, EventArgs.Empty);\r
-        }\r
         \r
         /// <summary>\r
         /// Run through all the jobs on the queue.\r
index ea81a9c03f929d55c7a94c479cb46f47db05ccbb..7be5db8f01808331029adad2b9684a44b6e65053 100644 (file)
@@ -216,6 +216,17 @@ namespace HandBrakeWPF.Services.Scan
 
         #region Private Methods
 
+        /// <summary>
+        /// The service log message.
+        /// </summary>
+        /// <param name="message">
+        /// The message.
+        /// </param>
+        protected void ServiceLogMessage(string message)
+        {
+            this.log.LogMessage(string.Format("{0} # {1}{0}", Environment.NewLine, message), LogMessageType.ScanOrEncode, LogLevel.Info);
+        }
+
         /// <summary>
         /// Start a scan for a given source path and title
         /// </summary>
@@ -263,6 +274,7 @@ namespace HandBrakeWPF.Services.Scan
         #endregion
 
         #region HandBrakeInstance Event Handlers
+        
         /// <summary>
         /// Scan Completed Event Handler
         /// </summary>
@@ -347,7 +359,7 @@ namespace HandBrakeWPF.Services.Scan
         /// <returns>
         /// The convert titles.
         /// </returns>
-        internal static List<Title> ConvertTitles(JsonScanObject titles)
+        private static List<Title> ConvertTitles(JsonScanObject titles)
         {
             List<Title> titleList = new List<Title>();
             foreach (SourceTitle title in titles.TitleList)
@@ -434,17 +446,6 @@ namespace HandBrakeWPF.Services.Scan
 
             return titleList;
         }
-
-        /// <summary>
-        /// The service log message.
-        /// </summary>
-        /// <param name="message">
-        /// The message.
-        /// </param>
-        protected void ServiceLogMessage(string message)
-        {
-            this.log.LogMessage(string.Format("{0} # {1}{0}", Environment.NewLine, message), LogMessageType.ScanOrEncode, LogLevel.Info);
-        }
         #endregion
     }
 }
\ No newline at end of file
index acff3209aecca9ca1bb77e7c89261df635cf52b1..6d8994ac5aefc24a85ba93715891dbb3589ed31f 100644 (file)
@@ -37,7 +37,7 @@ namespace HandBrakeWPF.Services
         /// <summary>\r
         /// The XML Serializer \r
         /// </summary>\r
-        readonly XmlSerializer serializer = new XmlSerializer(typeof(Collections.SerializableDictionary<string, object>));\r
+        private readonly XmlSerializer serializer = new XmlSerializer(typeof(Collections.SerializableDictionary<string, object>));\r
 \r
         /// <summary>\r
         /// The User Settings\r
index 34fdf3a4483f05a88ea349acdbbbeeb3d80cb650..0282744f3ecd691d23cf35195e244f265b2c18fe 100644 (file)
@@ -72,18 +72,6 @@ namespace HandBrakeWPF.Utilities
             Execute.dispatcher = (Dispatcher)null;
         }
 
-        /// <summary>
-        /// The validate dispatcher.
-        /// </summary>
-        /// <exception cref="InvalidOperationException">
-        /// Not initialized with dispatcher.
-        /// </exception>
-        private static void ValidateDispatcher()
-        {
-            if (Execute.dispatcher == null)
-                throw new InvalidOperationException("Not initialized with dispatcher.");
-        }
-
         /// <summary>
         /// Executes the action on the UI thread asynchronously.
         /// </summary>
@@ -123,6 +111,20 @@ namespace HandBrakeWPF.Utilities
             return (Task)taskSource.Task;
         }
 
+        /// <summary>
+        /// Executes the action on the UI thread.
+        /// </summary>
+        /// <param name="action">The action to execute.</param>
+        public static void OnUIThread(this System.Action action)
+        {
+            if (Execute.executor != null)
+                Execute.executor(action);
+            else if (Execute.CheckAccess())
+                action();
+            else
+                Execute.OnUIThreadAsync(action).Wait();
+        }
+
         /// <summary>
         /// The check access.
         /// </summary>
@@ -137,17 +139,15 @@ namespace HandBrakeWPF.Utilities
         }
 
         /// <summary>
-        /// Executes the action on the UI thread.
+        /// The validate dispatcher.
         /// </summary>
-        /// <param name="action">The action to execute.</param>
-        public static void OnUIThread(this System.Action action)
+        /// <exception cref="InvalidOperationException">
+        /// Not initialized with dispatcher.
+        /// </exception>
+        private static void ValidateDispatcher()
         {
-            if (Execute.executor != null)
-                Execute.executor(action);
-            else if (Execute.CheckAccess())
-                action();
-            else
-                Execute.OnUIThreadAsync(action).Wait();
+            if (Execute.dispatcher == null)
+                throw new InvalidOperationException("Not initialized with dispatcher.");
         }
     }
 }
index ae3a401b28c4d20556587c2a38e3391d742568b3..08f206891c43c888c678535e712242e30d3de276 100644 (file)
@@ -84,19 +84,6 @@ namespace HandBrakeWPF.Utilities
             this.NotifyOfPropertyChange(ExtensionMethods.GetMemberInfo((Expression)property).Name);
         }
 
-        /// <summary>
-        /// Raises the <see cref="E:PropertyChanged"/> event directly.
-        /// </summary>
-        /// <param name="e">The <see cref="T:System.ComponentModel.PropertyChangedEventArgs"/> instance containing the event data.</param>
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        protected void OnPropertyChanged(PropertyChangedEventArgs e)
-        {
-            PropertyChangedEventHandler changedEventHandler = this.PropertyChanged;
-            if (changedEventHandler == null)
-                return;
-            changedEventHandler((object)this, e);
-        }
-
         /// <summary>
         /// Called when the object is deserialized.
         /// </summary>
@@ -117,5 +104,18 @@ namespace HandBrakeWPF.Utilities
         {
             return false;
         }
+
+        /// <summary>
+        /// Raises the <see cref="E:PropertyChanged"/> event directly.
+        /// </summary>
+        /// <param name="e">The <see cref="T:System.ComponentModel.PropertyChangedEventArgs"/> instance containing the event data.</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        protected void OnPropertyChanged(PropertyChangedEventArgs e)
+        {
+            PropertyChangedEventHandler changedEventHandler = this.PropertyChanged;
+            if (changedEventHandler == null)
+                return;
+            changedEventHandler((object)this, e);
+        }
     }
 }
index c90c9add35314ee85f5b6f15716b32851db0a20f..ffea2554ee3ae688697913af7411e2f263009608 100644 (file)
@@ -305,6 +305,24 @@ namespace HandBrakeWPF.ViewModels
             this.NotifyOfPropertyChange(() => this.Task);\r
         }\r
 \r
+        /// <summary>\r
+        /// Add all remaining for selected languages.\r
+        /// </summary>\r
+        public void AddAllRemainingForSelectedLanguages()\r
+        {\r
+            // Add them if they are not already added.\r
+            foreach (Audio sourceTrack in this.GetSelectedLanguagesTracks())\r
+            {\r
+                // Step 2: Check if the track list already contrains this track\r
+                bool found = this.Task.AudioTracks.Any(audioTrack => Equals(audioTrack.ScannedTrack, sourceTrack));\r
+                if (!found)\r
+                {\r
+                    // If it doesn't, add it.\r
+                    this.Add(sourceTrack, true);\r
+                }\r
+            }\r
+        }\r
+\r
         #endregion\r
 \r
         #region Methods\r
@@ -442,24 +460,6 @@ namespace HandBrakeWPF.ViewModels
             }\r
         }\r
 \r
-        /// <summary>\r
-        /// Add all remaining for selected languages.\r
-        /// </summary>\r
-        public void AddAllRemainingForSelectedLanguages()\r
-        {\r
-            // Add them if they are not already added.\r
-            foreach (Audio sourceTrack in this.GetSelectedLanguagesTracks())\r
-            {\r
-                // Step 2: Check if the track list already contrains this track\r
-                bool found = this.Task.AudioTracks.Any(audioTrack => Equals(audioTrack.ScannedTrack, sourceTrack));\r
-                if (!found)\r
-                {\r
-                    // If it doesn't, add it.\r
-                    this.Add(sourceTrack, true);\r
-                }\r
-            }\r
-        }\r
-\r
         /// <summary>\r
         /// The get preferred audio track, or the first if none available.\r
         /// </summary>\r
index ce82439f1c53ecb7b307bd5549eccc4e3841e1ba..85ac495ffcf054bcb557ad2803b76c1d49a6f42d 100644 (file)
@@ -107,6 +107,21 @@ namespace HandBrakeWPF.ViewModels
             base.OnActivate();\r
         }\r
 \r
+        /// <summary>\r
+        /// Trigger a faster / smoother way of updating the log window.\r
+        /// </summary>\r
+        /// <param name="e">\r
+        /// The e.\r
+        /// </param>\r
+        protected virtual void OnLogMessageReceived(LogEventArgs e)\r
+        {\r
+            var onLogMessageReceived = this.LogMessageReceived;\r
+            if (onLogMessageReceived != null)\r
+            {\r
+                onLogMessageReceived.Invoke(this, e);\r
+            }\r
+        }\r
+\r
         /// <summary>\r
         /// Handle the OnDeactivate Caliburn Event\r
         /// </summary>\r
@@ -172,20 +187,5 @@ namespace HandBrakeWPF.ViewModels
                         });\r
             }\r
         }\r
-\r
-        /// <summary>\r
-        /// Trigger a faster / smoother way of updating the log window.\r
-        /// </summary>\r
-        /// <param name="e">\r
-        /// The e.\r
-        /// </param>\r
-        protected virtual void OnLogMessageReceived(LogEventArgs e)\r
-        {\r
-            var onLogMessageReceived = this.LogMessageReceived;\r
-            if (onLogMessageReceived != null)\r
-            {\r
-                onLogMessageReceived.Invoke(this, e);\r
-            }\r
-        }\r
     }\r
 }
\ No newline at end of file
index fbe0f6ad0e585b04a5ac89018075c7979e374255..f29e6fac05a0585efda1ee63df3d1b472de3f009 100644 (file)
@@ -2091,6 +2091,33 @@ namespace HandBrakeWPF.ViewModels
             }\r
         }\r
 \r
+        /// <summary>\r
+        /// The process drive.\r
+        /// </summary>\r
+        /// <param name="item">\r
+        /// The item.\r
+        /// </param>\r
+        public void ProcessDrive(object item)\r
+        {\r
+            if (item != null)\r
+            {\r
+                if (item.GetType() == typeof(DriveInformation))\r
+                {\r
+                    this.StartScan(((DriveInformation)item).RootDirectory, 0);\r
+                }\r
+                else if (item.GetType() == typeof(SourceMenuItem))\r
+                {\r
+                    DriveInformation driveInfo = ((SourceMenuItem)item).Tag as DriveInformation;\r
+                    if (driveInfo != null)\r
+                    {\r
+                        this.StartScan(driveInfo.RootDirectory, this.TitleSpecificScan);\r
+                    }\r
+\r
+                    this.ShowSourceSelection = false;\r
+                }\r
+            }\r
+        }\r
+\r
         #endregion\r
 \r
         #region Private Methods\r
@@ -2516,33 +2543,6 @@ namespace HandBrakeWPF.ViewModels
               });\r
         }\r
 \r
-        /// <summary>\r
-        /// The process drive.\r
-        /// </summary>\r
-        /// <param name="item">\r
-        /// The item.\r
-        /// </param>\r
-        public void ProcessDrive(object item)\r
-        {\r
-            if (item != null)\r
-            {\r
-                if (item.GetType() == typeof(DriveInformation))\r
-                {\r
-                    this.StartScan(((DriveInformation)item).RootDirectory, 0);\r
-                }\r
-                else if (item.GetType() == typeof(SourceMenuItem))\r
-                {\r
-                    DriveInformation driveInfo = ((SourceMenuItem)item).Tag as DriveInformation;\r
-                    if (driveInfo != null)\r
-                    {\r
-                        this.StartScan(driveInfo.RootDirectory, this.TitleSpecificScan);\r
-                    }\r
-\r
-                    this.ShowSourceSelection = false;\r
-                }\r
-            }\r
-        }\r
-\r
         /// <summary>\r
         /// Allows the main window to respond to setting changes.\r
         /// </summary>\r
index d98fb2d256547e38729fbb5eb40f9efd6f1dae60..69338721b262fcc222af5627330b3f73274d14c1 100644 (file)
@@ -1123,15 +1123,6 @@ namespace HandBrakeWPF.ViewModels
 \r
         #region Public Methods\r
 \r
-        /// <summary>\r
-        /// Load / Update the user settings.\r
-        /// </summary>\r
-        protected override void OnActivate()\r
-        {\r
-            this.OnLoad();\r
-            base.OnActivate();\r
-        }\r
-\r
         /// <summary>\r
         /// Close this window.\r
         /// </summary>\r
@@ -1244,7 +1235,7 @@ namespace HandBrakeWPF.ViewModels
         /// </summary>\r
         public void BrowseWhenDoneAudioFile()\r
         {\r
-            OpenFileDialog dialog = new  OpenFileDialog() { Filter = "All Files|*.wav;*.mp3", FileName = this.WhenDoneAudioFileFullPath };\r
+            OpenFileDialog dialog = new OpenFileDialog() { Filter = "All Files|*.wav;*.mp3", FileName = this.WhenDoneAudioFileFullPath };\r
             bool? dialogResult = dialog.ShowDialog();\r
             if (dialogResult.HasValue && dialogResult.Value)\r
             {\r
@@ -1437,6 +1428,15 @@ namespace HandBrakeWPF.ViewModels
             this.SelectedTab = tab;\r
         }\r
 \r
+        /// <summary>\r
+        /// Load / Update the user settings.\r
+        /// </summary>\r
+        protected override void OnActivate()\r
+        {\r
+            this.OnLoad();\r
+            base.OnActivate();\r
+        }\r
+\r
         /// <summary>\r
         /// Save the settings selected\r
         /// </summary>\r
index 9e002ae365f614d7ca43af43ba135d79941f835c..f1191edae832fcbf01067f24e88e0810eaa8aac1 100644 (file)
@@ -41,7 +41,7 @@ namespace HandBrakeWPF.ViewModels
 \r
         #region Constants and Fields\r
 \r
-        private readonly Subtitle ForeignAudioSearchTrack;\r
+        private readonly Subtitle foreignAudioSearchTrack;\r
         private IList<Subtitle> sourceTracks;\r
 \r
         #endregion\r
@@ -63,8 +63,8 @@ namespace HandBrakeWPF.ViewModels
             this.Langauges = LanguageUtilities.MapLanguages().Keys;\r
             this.CharacterCodes = CharCodesUtilities.GetCharacterCodes();\r
 \r
-            this.ForeignAudioSearchTrack = new Subtitle { SubtitleType = SubtitleType.ForeignAudioSearch, Language = "Foreign Audio Search" };\r
-            this.SourceTracks = new List<Subtitle> { this.ForeignAudioSearchTrack };\r
+            this.foreignAudioSearchTrack = new Subtitle { SubtitleType = SubtitleType.ForeignAudioSearch, Language = "Foreign Audio Search" };\r
+            this.SourceTracks = new List<Subtitle> { this.foreignAudioSearchTrack };\r
         }\r
 \r
         #endregion\r
@@ -326,7 +326,7 @@ namespace HandBrakeWPF.ViewModels
             // Add Foreign Audio Scan\r
             if (this.SubtitleBehaviours.AddForeignAudioScanTrack)\r
             {\r
-                this.Add(ForeignAudioSearchTrack);\r
+                this.Add(foreignAudioSearchTrack);\r
             }\r
 \r
             // Add Track Behaviours\r
@@ -496,7 +496,7 @@ namespace HandBrakeWPF.ViewModels
         public void SetSource(Source source, Title title, Preset preset, EncodeTask task)\r
         {\r
             this.SourceTracks.Clear();\r
-            this.SourceTracks.Add(ForeignAudioSearchTrack);\r
+            this.SourceTracks.Add(foreignAudioSearchTrack);\r
             foreach (Subtitle subtitle in title.Subtitles)\r
             {\r
                 this.SourceTracks.Add(subtitle);\r
@@ -534,7 +534,7 @@ namespace HandBrakeWPF.ViewModels
 \r
             if (source == null)\r
             {\r
-                source = ForeignAudioSearchTrack;\r
+                source = foreignAudioSearchTrack;\r
             }\r
 \r
             SubtitleTrack track = new SubtitleTrack\r
index c1a45a58fcaf94dfeb012e0b39b234d900d8a85b..6fe0187bcde75e7c38aa985df94e9dacbc9898b0 100644 (file)
@@ -45,14 +45,11 @@ namespace HandBrakeWPF.Views
         {\r
             this.InitializeComponent();\r
 \r
-\r
-\r
             IUserSettingService userSettingService = IoC.Get<IUserSettingService>();\r
             bool minimiseToTray = userSettingService.GetUserSetting<bool>(UserSettingConstants.MainWindowMinimize);\r
 \r
             if (minimiseToTray)\r
             {\r
-\r
                 INotifyIconService notifyIconService = IoC.Get<INotifyIconService>();\r
                 this.notifyIcon = new NotifyIcon();\r
                 this.notifyIcon.ContextMenu = new ContextMenu(new[] { new MenuItem("Restore", NotifyIconClick), new MenuItem("Mini Status Display", ShowMiniStatusDisplay) });\r
@@ -86,6 +83,33 @@ namespace HandBrakeWPF.Views
             }\r
         }\r
 \r
+        /// <summary>\r
+        /// Check with the user before closing.\r
+        /// </summary>\r
+        /// <param name="e">\r
+        /// The CancelEventArgs.\r
+        /// </param>\r
+        protected override void OnClosing(CancelEventArgs e)\r
+        {\r
+            IShellViewModel shellViewModel = this.DataContext as IShellViewModel;\r
+\r
+            if (shellViewModel != null)\r
+            {\r
+                bool canClose = shellViewModel.CanClose();\r
+                if (!canClose)\r
+                {\r
+                    e.Cancel = true;\r
+                }\r
+            }\r
+\r
+            if (this.notifyIcon != null)\r
+            {\r
+                this.notifyIcon.Visible = false;\r
+            }\r
+\r
+            base.OnClosing(e);\r
+        }\r
+\r
         /// <summary>\r
         /// The show mini status display.\r
         /// </summary>\r
@@ -146,32 +170,5 @@ namespace HandBrakeWPF.Views
                 }\r
             }\r
         }\r
-\r
-        /// <summary>\r
-        /// Check with the user before closing.\r
-        /// </summary>\r
-        /// <param name="e">\r
-        /// The CancelEventArgs.\r
-        /// </param>\r
-        protected override void OnClosing(CancelEventArgs e)\r
-        {\r
-            IShellViewModel shellViewModel = this.DataContext as IShellViewModel;\r
-\r
-            if (shellViewModel != null)\r
-            {\r
-                bool canClose = shellViewModel.CanClose();\r
-                if (!canClose)\r
-                {\r
-                    e.Cancel = true;\r
-                }\r
-            }\r
-\r
-            if (this.notifyIcon != null)\r
-            {\r
-                this.notifyIcon.Visible = false;\r
-            }\r
-\r
-            base.OnClosing(e);\r
-        }\r
     }\r
 }\r