]> granicus.if.org Git - handbrake/commitdiff
App Services Modelling Tidy Up
authorScott <sr55.hb@outlook.com>
Sat, 26 Sep 2015 20:29:34 +0000 (21:29 +0100)
committerScott <sr55.hb@outlook.com>
Sat, 26 Sep 2015 20:30:33 +0000 (21:30 +0100)
Making event objects immutable. Making Libhb constructs internal to the
library. We should expose this with a managed api if we need it outside
the library. (Part 1)

20 files changed:
win/CS/HandBrake.ApplicationServices/Attributes/ShortName.cs
win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj
win/CS/HandBrake.ApplicationServices/Interop/EventArgs/EncodeCompletedEventArgs.cs
win/CS/HandBrake.ApplicationServices/Interop/EventArgs/EncodeProgressEventArgs.cs
win/CS/HandBrake.ApplicationServices/Interop/EventArgs/MessageLoggedEventArgs.cs
win/CS/HandBrake.ApplicationServices/Interop/EventArgs/ScanProgressEventArgs.cs
win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs
win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUnitConversionHelpers.cs
win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs
win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_anamorphic_mode_t.cs
win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_container_s.cs
win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_encoder_s.cs
win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_mixdown_s.cs
win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_rate_s.cs
win/CS/HandBrake.ApplicationServices/Interop/HbLib/iso639_lang_t.cs
win/CS/HandBrake.ApplicationServices/Interop/Model/Preview/PreviewSettings.cs
win/CS/HandBrakeWPF/HandBrakeWPF.csproj
win/CS/HandBrakeWPF/Helpers/PictureSize.cs
win/CS/HandBrakeWPF/Helpers/Validate.cs [moved from win/CS/HandBrake.ApplicationServices/Interop/Helpers/Validate.cs with 92% similarity]
win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs

index eab372e345202f95219f8b3e09d9c96df70bad0f..10a4d16310646b0647799770d72083b408e3d763 100644 (file)
@@ -30,6 +30,6 @@ namespace HandBrake.ApplicationServices.Attributes
         /// <summary>\r
         /// Gets or sets the short name.\r
         /// </summary>\r
-        public string Name { get; set; }\r
+        public string Name { get; private set; }\r
     }\r
 }\r
index 89562540f06fb20ca64c2df06f27b6e32cd55217..1a99efd1d0ca06d398db30f2ae9d4021a072fbd7 100644 (file)
     <Compile Include="Interop\Helpers\InteropUtilities.cs" />\r
     <Compile Include="Interop\Helpers\NativeList.cs" />\r
     <Compile Include="Interop\Helpers\Utilities.cs" />\r
-    <Compile Include="Interop\Helpers\Validate.cs" />\r
     <Compile Include="Interop\Interfaces\IHandBrakeInstance.cs" />\r
     <Compile Include="Interop\Json\Anamorphic\AnamorphicGeometry.cs" />\r
     <Compile Include="Interop\Json\Anamorphic\DestSettings.cs" />\r
index fa1ea14c37bb52d9cbbd2c50b35763ea9d51e78d..52b5719feb12049130ec6960cc5c286fb7c5eedd 100644 (file)
@@ -17,8 +17,19 @@ namespace HandBrake.ApplicationServices.Interop.EventArgs
     public class EncodeCompletedEventArgs : EventArgs\r
     {\r
         /// <summary>\r
-        /// Gets or sets a value indicating whether an error occurred during the encode.\r
+        /// Initializes a new instance of the <see cref="EncodeCompletedEventArgs"/> class.\r
         /// </summary>\r
-        public bool Error { get; set; }\r
+        /// <param name="error">\r
+        /// The error.\r
+        /// </param>\r
+        public EncodeCompletedEventArgs(bool error)\r
+        {\r
+            this.Error = error;\r
+        }\r
+\r
+        /// <summary>\r
+        /// Gets a value indicating whether an error occurred during the encode.\r
+        /// </summary>\r
+        public bool Error { get; private set; }\r
     }\r
 }\r
index d58798e8143c73059267f7c68ba075478075888e..5fad3248cf3be8be4a4f433b393a8aff6fb21bda 100644 (file)
@@ -17,27 +17,62 @@ namespace HandBrake.ApplicationServices.Interop.EventArgs
     public class EncodeProgressEventArgs : EventArgs\r
     {\r
         /// <summary>\r
-        /// Gets or sets FractionComplete.\r
+        /// Initializes a new instance of the <see cref="EncodeProgressEventArgs"/> class.\r
         /// </summary>\r
-        public double FractionComplete { get; set; }\r
+        /// <param name="fractionComplete">\r
+        /// The fraction complete.\r
+        /// </param>\r
+        /// <param name="currentFrameRate">\r
+        /// The current frame rate.\r
+        /// </param>\r
+        /// <param name="averageFrameRate">\r
+        /// The average frame rate.\r
+        /// </param>\r
+        /// <param name="estimatedTimeLeft">\r
+        /// The estimated time left.\r
+        /// </param>\r
+        /// <param name="passId">\r
+        /// The pass id.\r
+        /// </param>\r
+        /// <param name="pass">\r
+        /// The pass.\r
+        /// </param>\r
+        /// <param name="passCount">\r
+        /// The pass count.\r
+        /// </param>\r
+        public EncodeProgressEventArgs(double fractionComplete, double currentFrameRate, double averageFrameRate, TimeSpan estimatedTimeLeft, int passId, int pass, int passCount)\r
+        {\r
+            this.FractionComplete = fractionComplete;\r
+            this.CurrentFrameRate = currentFrameRate;\r
+            this.AverageFrameRate = averageFrameRate;\r
+            this.EstimatedTimeLeft = estimatedTimeLeft;\r
+            this.PassId = passId;\r
+            this.Pass = pass;\r
+            this.PassCount = passCount;\r
+        }\r
 \r
         /// <summary>\r
-        /// Gets or sets CurrentFrameRate.\r
+        /// Gets the % Complete.\r
         /// </summary>\r
-        public double CurrentFrameRate { get; set; }\r
+        public double FractionComplete { get; private set; }\r
 \r
         /// <summary>\r
-        /// Gets or sets AverageFrameRate.\r
+        /// Gets the Current FrameRate.\r
         /// </summary>\r
-        public double AverageFrameRate { get; set; }\r
+        public double CurrentFrameRate { get; private set; }\r
 \r
         /// <summary>\r
-        /// Gets or sets EstimatedTimeLeft.\r
+        /// Gets the Average FrameRate.\r
         /// </summary>\r
-        public TimeSpan EstimatedTimeLeft { get; set; }\r
+        public double AverageFrameRate { get; private set; }\r
 \r
         /// <summary>\r
-        /// Gets or sets the pass ID.\r
+        /// Gets the Estimated Time Left.\r
+        /// </summary>\r
+        public TimeSpan EstimatedTimeLeft { get; private set; }\r
+\r
+        /// <summary>\r
+        /// Gets the pass ID.\r
         /// </summary>\r
         /// <remarks>\r
         /// -1: Subtitle scan\r
@@ -45,16 +80,16 @@ namespace HandBrake.ApplicationServices.Interop.EventArgs
         ///  1: Encode first pass\r
         ///  2: Encode second pass\r
         /// </remarks>\r
-        public int PassId { get; set; }\r
+        public int PassId { get; private set; }\r
 \r
         /// <summary>\r
-        /// Gets or sets the current encoding pass. (1-based)\r
+        /// Gets the current encoding pass. (1-based)\r
         /// </summary>\r
-        public int Pass { get; set; }\r
+        public int Pass { get; private set; }\r
 \r
         /// <summary>\r
-        /// Gets or sets the pass count.\r
+        /// Gets the pass count.\r
         /// </summary>\r
-        public int PassCount { get; set; }\r
+        public int PassCount { get; private set; }\r
     }\r
 }\r
index e547a2fe898bb6c41d4a5184b99f4be51d8c8fdb..610ab0a77a4788393671349fba8470ba9565b5d4 100644 (file)
@@ -17,8 +17,19 @@ namespace HandBrake.ApplicationServices.Interop.EventArgs
     public class MessageLoggedEventArgs : EventArgs\r
     {\r
         /// <summary>\r
-        /// Gets or sets Message.\r
+        /// Initializes a new instance of the <see cref="MessageLoggedEventArgs"/> class.\r
         /// </summary>\r
-        public string Message { get; set; }\r
+        /// <param name="message">\r
+        /// The message.\r
+        /// </param>\r
+        public MessageLoggedEventArgs(string message)\r
+        {\r
+            this.Message = message;\r
+        }\r
+\r
+        /// <summary>\r
+        /// Gets the Message.\r
+        /// </summary>\r
+        public string Message { get; private set; }\r
     }\r
 }\r
index 3928a53e6656a6442d581e67780b1202ab3fa2d4..78737943e1b7ebdb027aa9d14ea9bb394175748c 100644 (file)
@@ -17,28 +17,55 @@ namespace HandBrake.ApplicationServices.Interop.EventArgs
     public class ScanProgressEventArgs : EventArgs\r
     {\r
         /// <summary>\r
-        /// Gets or sets the total progress fraction for the scan.\r
+        /// Initializes a new instance of the <see cref="ScanProgressEventArgs"/> class.\r
         /// </summary>\r
-        public double Progress { get; set; }\r
+        /// <param name="progress">\r
+        /// The progress.\r
+        /// </param>\r
+        /// <param name="currentPreview">\r
+        /// The current preview.\r
+        /// </param>\r
+        /// <param name="previews">\r
+        /// The previews.\r
+        /// </param>\r
+        /// <param name="currentTitle">\r
+        /// The current title.\r
+        /// </param>\r
+        /// <param name="titles">\r
+        /// The titles.\r
+        /// </param>\r
+        public ScanProgressEventArgs(double progress, int currentPreview, int previews, int currentTitle, int titles)\r
+        {\r
+            this.Progress = progress;\r
+            this.CurrentPreview = currentPreview;\r
+            this.Previews = previews;\r
+            this.CurrentTitle = currentTitle;\r
+            this.Titles = titles;\r
+        }\r
 \r
         /// <summary>\r
-        /// Gets or sets the current preview being processed on the scan.\r
+        /// Gets the total progress fraction for the scan.\r
         /// </summary>\r
-        public int CurrentPreview { get; set; }\r
+        public double Progress { get; private set; }\r
 \r
         /// <summary>\r
-        /// Gets or sets the total number of previews to process.\r
+        /// Gets the current preview being processed on the scan.\r
         /// </summary>\r
-        public int Previews { get; set; }\r
+        public int CurrentPreview { get; private set; }\r
 \r
         /// <summary>\r
-        /// Gets or sets the current title being processed on the scan.\r
+        /// Gets the total number of previews to process.\r
         /// </summary>\r
-        public int CurrentTitle { get; set; }\r
+        public int Previews { get; private set; }\r
 \r
         /// <summary>\r
-        /// Gets or sets the total number of titles to process.\r
+        /// Gets the current title being processed on the scan.\r
         /// </summary>\r
-        public int Titles { get; set; }\r
+        public int CurrentTitle { get; private set; }\r
+\r
+        /// <summary>\r
+        /// Gets the total number of titles to process.\r
+        /// </summary>\r
+        public int Titles { get; private set; }\r
     }\r
 }\r
index 62e4e1b5cdff0b1615745f017d9dcc21f7afe8cc..a862dc1e64134d04b61c4a4cfbbb903e9e5c6227 100644 (file)
@@ -268,7 +268,6 @@ namespace HandBrake.ApplicationServices.Interop
         public BitmapImage GetPreview(PreviewSettings settings, int previewNumber)\r
         {\r
             SourceTitle title = this.Titles.TitleList.FirstOrDefault(t => t.Index == settings.TitleNumber);\r
-            Validate.NotNull(title, "GetPreview: Title should not have been null. This is probably a bug.");\r
 \r
             // Create the Expected Output Geometry details for libhb.\r
             hb_geometry_settings_s uiGeometry = new hb_geometry_settings_s\r
@@ -510,14 +509,7 @@ namespace HandBrake.ApplicationServices.Interop
             {\r
                 if (this.ScanProgress != null)\r
                 {\r
-                    this.ScanProgress(this, new ScanProgressEventArgs\r
-                    {\r
-                        Progress = state.Scanning.Progress, \r
-                        CurrentPreview = state.Scanning.Preview, \r
-                        Previews = state.Scanning.PreviewCount, \r
-                        CurrentTitle = state.Scanning.Title, \r
-                        Titles = state.Scanning.TitleCount\r
-                    });\r
+                    this.ScanProgress(this, new ScanProgressEventArgs(state.Scanning.Progress, state.Scanning.Preview, state.Scanning.PreviewCount, state.Scanning.Title, state.Scanning.TitleCount));\r
                 }\r
             }\r
             else if (state != null && state.State == NativeConstants.HB_STATE_SCANDONE)\r
@@ -557,16 +549,8 @@ namespace HandBrake.ApplicationServices.Interop
             {\r
                 if (this.EncodeProgress != null)\r
                 {\r
-                    var progressEventArgs = new EncodeProgressEventArgs\r
-                    {\r
-                        FractionComplete = state.Working.Progress, \r
-                        CurrentFrameRate = state.Working.Rate, \r
-                        AverageFrameRate = state.Working.RateAvg, \r
-                        EstimatedTimeLeft = new TimeSpan(state.Working.Hours, state.Working.Minutes, state.Working.Seconds),\r
-                        PassId = state.Working.PassID,\r
-                        Pass = state.Working.Pass,\r
-                        PassCount = state.Working.PassCount\r
-                    };\r
+                    var progressEventArgs = new EncodeProgressEventArgs(state.Working.Progress, state.Working.Rate, state.Working.RateAvg, new TimeSpan(state.Working.Hours, state.Working.Minutes, state.Working.Seconds),\r
+                        state.Working.PassID, state.Working.Pass, state.Working.PassCount);\r
 \r
                     this.EncodeProgress(this, progressEventArgs);\r
                 }\r
@@ -577,10 +561,9 @@ namespace HandBrake.ApplicationServices.Interop
 \r
                 if (this.EncodeCompleted != null)\r
                 {\r
-                    this.EncodeCompleted(this, new EncodeCompletedEventArgs\r
-                    {\r
-                        Error = state.WorkDone.Error != (int)hb_error_code.HB_ERROR_NONE\r
-                    });\r
+                    this.EncodeCompleted(\r
+                        this,\r
+                        new EncodeCompletedEventArgs(state.WorkDone.Error != (int)hb_error_code.HB_ERROR_NONE));\r
                 }\r
             }\r
         }\r
index 758cfd3026310b0620951d18e21534e94b7074de..7b981b7af5cf12c56a6ac8d43e51ab7f2a3b7fcb 100644 (file)
@@ -73,7 +73,7 @@ namespace HandBrake.ApplicationServices.Interop
         /// <returns>\r
         /// The converted model.\r
         /// </returns>\r
-        public static HBVideoEncoder NativeToVideoEncoder(hb_encoder_s encoder)\r
+        internal static HBVideoEncoder NativeToVideoEncoder(hb_encoder_s encoder)\r
         {\r
             return new HBVideoEncoder\r
             {\r
@@ -93,7 +93,7 @@ namespace HandBrake.ApplicationServices.Interop
         /// <returns>\r
         /// The converted model.\r
         /// </returns>\r
-        public static HBAudioEncoder NativeToAudioEncoder(hb_encoder_s encoder)\r
+        internal static HBAudioEncoder NativeToAudioEncoder(hb_encoder_s encoder)\r
         {\r
             var result = new HBAudioEncoder\r
                              {\r
@@ -120,7 +120,7 @@ namespace HandBrake.ApplicationServices.Interop
         /// <returns>\r
         /// The converted rate object.\r
         /// </returns>\r
-        public static HBRate NativeToRate(hb_rate_s rate)\r
+        internal static HBRate NativeToRate(hb_rate_s rate)\r
         {\r
             return new HBRate\r
                 {\r
@@ -138,7 +138,7 @@ namespace HandBrake.ApplicationServices.Interop
         /// <returns>\r
         /// The converted model.\r
         /// </returns>\r
-        public static HBMixdown NativeToMixdown(hb_mixdown_s mixdown)\r
+        internal static HBMixdown NativeToMixdown(hb_mixdown_s mixdown)\r
         {\r
             return new HBMixdown\r
                 {\r
@@ -157,7 +157,7 @@ namespace HandBrake.ApplicationServices.Interop
         /// <returns>\r
         /// The converted structure.\r
         /// </returns>\r
-        public static HBContainer NativeToContainer(hb_container_s container)\r
+        internal static HBContainer NativeToContainer(hb_container_s container)\r
         {\r
             return new HBContainer\r
                 {\r
@@ -177,7 +177,7 @@ namespace HandBrake.ApplicationServices.Interop
         /// <returns>\r
         /// The converted structure.\r
         /// </returns>\r
-        public static Language NativeToLanguage(iso639_lang_t language)\r
+        internal static Language NativeToLanguage(iso639_lang_t language)\r
         {\r
             string englishName = InteropUtilities.ToStringFromUtf8Ptr(language.eng_name);\r
             string nativeName = InteropUtilities.ToStringFromUtf8Ptr(language.native_name);\r
index ccbaee4c18a509286e17f0ce5b944958459b6b12..704e794ef61d68c94057308619e90e24dfe0d899 100644 (file)
@@ -316,7 +316,7 @@ namespace HandBrake.ApplicationServices.Interop
         {\r
             if (MessageLogged != null)\r
             {\r
-                MessageLogged(null, new MessageLoggedEventArgs { Message = message });\r
+                MessageLogged(null, new MessageLoggedEventArgs(message));\r
             }\r
 \r
             Debug.WriteLine(message);\r
@@ -332,7 +332,7 @@ namespace HandBrake.ApplicationServices.Interop
         {\r
             if (ErrorLogged != null)\r
             {\r
-                ErrorLogged(null, new MessageLoggedEventArgs { Message = message });\r
+                ErrorLogged(null, new MessageLoggedEventArgs(message));\r
             }\r
 \r
             Debug.WriteLine("ERROR: " + message);\r
index 6940e73a81e9bdd28ee7e5aa5599ec9428246ebb..ef0bf03f48e0a4162ebfa118a5c118095dfd1aee 100644 (file)
@@ -10,7 +10,7 @@
 \r
 namespace HandBrake.ApplicationServices.Interop.HbLib\r
 {\r
-    public enum hb_anamorphic_mode_t\r
+    internal enum hb_anamorphic_mode_t\r
     {\r
         HB_ANAMORPHIC_NONE,\r
         HB_ANAMORPHIC_STRICT,\r
index b9a8f3255664af87d583cf8bdab175a9e227b481..156bc75540b2161f47aaf20ce6981c34dbbf78d1 100644 (file)
@@ -10,7 +10,7 @@ namespace HandBrake.ApplicationServices.Interop.HbLib
     using System.Runtime.InteropServices;\r
 \r
     [StructLayout(LayoutKind.Sequential)]\r
-    public struct hb_container_s\r
+    internal struct hb_container_s\r
     {\r
         [MarshalAs(UnmanagedType.LPStr)]\r
         public string name;\r
index 9491cb16074ae86417f99339bdd61fc04d84487f..6fddc1827bfbd74ddebfe10d740394b948fc0960 100644 (file)
@@ -10,7 +10,7 @@ namespace HandBrake.ApplicationServices.Interop.HbLib
     using System.Runtime.InteropServices;\r
 \r
     [StructLayout(LayoutKind.Sequential)]\r
-    public struct hb_encoder_s\r
+    internal struct hb_encoder_s\r
     {\r
         [MarshalAs(UnmanagedType.LPStr)]\r
         public string name;\r
index 768ec31892362a429706c759cb63dfec84781e7d..726ebf226fbf5c6472b7110a6f46ed080d2dab2d 100644 (file)
@@ -10,7 +10,7 @@ namespace HandBrake.ApplicationServices.Interop.HbLib
     using System.Runtime.InteropServices;\r
 \r
     [StructLayout(LayoutKind.Sequential)]\r
-    public struct hb_mixdown_s\r
+    internal struct hb_mixdown_s\r
     {\r
         [MarshalAs(UnmanagedType.LPStr)]\r
         public string name;\r
index bebeccb7f28ba63a87dbe7e4aa5fc03bc2b15a3a..5a4f48b4adc52890e1f8ad616570960af0a772dd 100644 (file)
@@ -10,7 +10,7 @@ namespace HandBrake.ApplicationServices.Interop.HbLib
     using System.Runtime.InteropServices;\r
 \r
     [StructLayout(LayoutKind.Sequential)]\r
-    public struct hb_rate_s\r
+    internal struct hb_rate_s\r
     {\r
         /// char*\r
         [MarshalAs(UnmanagedType.LPStr)]\r
index 1a4780ab22405420d87446e1e013766b20fde186..86aa71dd832c432e951bc5f8053e954a74705fdb 100644 (file)
@@ -11,7 +11,7 @@ namespace HandBrake.ApplicationServices.Interop.HbLib
     using System.Runtime.InteropServices;\r
 \r
     [StructLayout(LayoutKind.Sequential)]\r
-    public struct iso639_lang_t\r
+    internal struct iso639_lang_t\r
     {\r
         public IntPtr eng_name;\r
 \r
index d413e003bdc1c2500f4752684c33f819d9089f23..b3c330a7cb3a5fc67b4065f6f8d9eedf1d34cd59 100644 (file)
@@ -9,7 +9,7 @@
 \r
 namespace HandBrake.ApplicationServices.Interop.Model.Preview\r
 {\r
-    using HandBrake.ApplicationServices.Interop.Model.Encoding;\r
+    using Encoding;\r
 \r
     /// <summary>\r
     /// The preview settings.\r
index 808b3d01533a272206984903ccd75d214197434c..fa2b4bf5ac2f8562665422bd91c3790c0705f87a 100644 (file)
     <Compile Include="EventArgs\SettingChangedEventArgs.cs" />\r
     <Compile Include="Exceptions\GeneralApplicationException.cs" />\r
     <Compile Include="Extensions\StringExtensions.cs" />\r
+    <Compile Include="Helpers\Validate.cs" />\r
     <Compile Include="Model\Audio\AudioTrackDefaultsMode.cs" />\r
     <Compile Include="Model\Audio\AudioBehaviourModes.cs" />\r
     <Compile Include="Model\Audio\AudioBehaviours.cs" />\r
index 12a99491446048d48c07940fb4372d7a9808b70f..5090339b51f3583d6df6dd4142497ae997b615f5 100644 (file)
@@ -184,7 +184,7 @@ namespace HandBrakeWPF.Helpers
                 keep = settingMode,\r
                 maxWidth = job.MaxWidth,\r
                 maxHeight = job.MaxHeight,\r
-                mode = (int)(hb_anamorphic_mode_t)job.AnamorphicMode,\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
             };\r
similarity index 92%
rename from win/CS/HandBrake.ApplicationServices/Interop/Helpers/Validate.cs
rename to win/CS/HandBrakeWPF/Helpers/Validate.cs
index 9725710e1c6b6f96737e02297a5ca9caa7a14f4b..7d307dfbc3bd207c96daa0778ee0bfd16c55c932 100644 (file)
@@ -1,39 +1,39 @@
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="Validate.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
-//   The validate.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
-\r
-namespace HandBrake.ApplicationServices.Interop.Helpers\r
-{\r
-    using System;\r
-\r
-    /// <summary>\r
-    /// The validate.\r
-    /// </summary>\r
-    public class Validate\r
-    {\r
-        /// <summary>\r
-        /// The not null.\r
-        /// </summary>\r
-        /// <param name="item">\r
-        /// The item.\r
-        /// </param>\r
-        /// <param name="message">\r
-        /// The message.\r
-        /// </param>\r
-        /// <exception cref="ArgumentException">\r
-        /// Thrown when the input object is null\r
-        /// </exception>\r
-        public static void NotNull(object item, string message)\r
-        {\r
-            if (item == null)\r
-            {\r
-                throw new ArgumentException(message);\r
-            }\r
-        }\r
-    }\r
-}\r
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="Validate.cs" company="HandBrake Project (http://handbrake.fr)">
+//   This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+//   The validate.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Helpers
+{
+    using System;
+
+    /// <summary>
+    /// The validate.
+    /// </summary>
+    public class Validate
+    {
+        /// <summary>
+        /// The not null.
+        /// </summary>
+        /// <param name="item">
+        /// The item.
+        /// </param>
+        /// <param name="message">
+        /// The message.
+        /// </param>
+        /// <exception cref="ArgumentException">
+        /// Thrown when the input object is null
+        /// </exception>
+        public static void NotNull(object item, string message)
+        {
+            if (item == null)
+            {
+                throw new ArgumentException(message);
+            }
+        }
+    }
+}
index bf456c859ce17a60901f2991b1e924e459f3c863..10037fc558817bb55e0910470ac7cb5d4552af0b 100644 (file)
@@ -36,6 +36,7 @@ namespace HandBrakeWPF.Services.Encode.Factories
     using PointToPointMode = HandBrakeWPF.Services.Encode.Model.Models.PointToPointMode;
     using Subtitle = HandBrake.ApplicationServices.Interop.Json.Encode.Subtitles;
     using SubtitleTrack = HandBrakeWPF.Services.Encode.Model.Models.SubtitleTrack;
+    using Validate = HandBrakeWPF.Helpers.Validate;
 
     /// <summary>
     /// This factory takes the internal EncodeJob object and turns it into a set of JSON models