]> granicus.if.org Git - handbrake/commitdiff
[Merge 0.10.x] WinGui: Fix an issue related to the Audio and Subtitle defaults not...
authorsr55 <sr55.hb@outlook.com>
Sun, 8 Feb 2015 14:41:10 +0000 (14:41 +0000)
committersr55 <sr55.hb@outlook.com>
Sun, 8 Feb 2015 14:41:10 +0000 (14:41 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/branches/0.10.x@6880 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/CS/HandBrake.ApplicationServices/Model/Audio/AudioBehaviours.cs
win/CS/HandBrake.ApplicationServices/Model/Preset.cs
win/CS/HandBrake.ApplicationServices/Model/Subtitle/SubtitleBehaviours.cs

index 4363ec56db2a56d7ca293eeca809e735f6a4447b..83b7249726697a45d04c7007601ee3a476e9f423 100644 (file)
@@ -10,6 +10,7 @@
 namespace HandBrake.ApplicationServices.Model.Audio\r
 {\r
     using System.ComponentModel;\r
+    using System.Linq;\r
 \r
     using Caliburn.Micro;\r
 \r
@@ -46,7 +47,7 @@ namespace HandBrake.ApplicationServices.Model.Audio
         public AudioBehaviours(AudioBehaviours behaviours)\r
         {\r
             this.SelectedBehaviour = behaviours.SelectedBehaviour;\r
-            this.SelectedLangauges = new BindingList<string>(behaviours.selectedLangauges);\r
+            this.SelectedLangauges = new BindingList<string>(behaviours.selectedLangauges.ToList());\r
         }\r
 \r
         /// <summary>\r
index 2bddd75aa35d982962f33d703455e20983d44ea2..de07ae48d3dc2c60d5d64fefd7652eae170934df 100644 (file)
@@ -146,5 +146,56 @@ namespace HandBrake.ApplicationServices.Model
         }\r
 \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
+        /// <param name="obj">\r
+        /// The obj.\r
+        /// </param>\r
+        /// <returns>\r
+        /// The <see cref="bool"/>.\r
+        /// </returns>\r
+        public override bool Equals(object obj)\r
+        {\r
+            if (ReferenceEquals(null, obj))\r
+            {\r
+                return false;\r
+            }\r
+            if (ReferenceEquals(this, obj))\r
+            {\r
+                return true;\r
+            }\r
+            if (obj.GetType() != this.GetType())\r
+            {\r
+                return false;\r
+            }\r
+            return Equals((Preset)obj);\r
+        }\r
+\r
+        /// <summary>\r
+        /// The get hash code.\r
+        /// </summary>\r
+        /// <returns>\r
+        /// The <see cref="int"/>.\r
+        /// </returns>\r
+        public override int GetHashCode()\r
+        {\r
+            return (this.Name != null ? this.Name.GetHashCode() : 0);\r
+        }\r
     }\r
 }
\ No newline at end of file
index c96357c3b58ab9f4ebd41d65eb0397ba5c0e22e8..d944100dbe5207dcc50773f300ca19e64006ff1e 100644 (file)
@@ -10,6 +10,7 @@
 namespace HandBrake.ApplicationServices.Model.Subtitle\r
 {\r
     using System.ComponentModel;\r
+    using System.Linq;\r
 \r
     using Caliburn.Micro;\r
 \r
@@ -56,7 +57,7 @@ namespace HandBrake.ApplicationServices.Model.Subtitle
         public SubtitleBehaviours(SubtitleBehaviours behaviours)\r
         {\r
             this.SelectedBehaviour = behaviours.selectedBehaviour;\r
-            this.SelectedLangauges = new BindingList<string>(behaviours.SelectedLangauges);\r
+            this.SelectedLangauges = new BindingList<string>(behaviours.SelectedLangauges.ToList());\r
         }\r
 \r
         /// <summary>\r