/[xmltv_parser]/trunk/libxmltv/Core/DataSourceBindable.cs
ViewVC logotype

Diff of /trunk/libxmltv/Core/DataSourceBindable.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/libxmltv/Core/DataSourceBindable.cs	2013/03/15 17:33:15	165
+++ trunk/libxmltv/Core/DataSourceBindable.cs	2013/03/16 17:56:55	181
@@ -181,7 +181,7 @@
             }
             #endregion
         }
-        public class ProgramDefintion : IProgramDefinition
+        public class ProgramDefintion : IProgramDefinition, IEquatable<IProgramDefinition>
         {
             public ProgramDefintion()
             {
@@ -216,7 +216,24 @@
                 }
                 return builder.ToString();
             }
-          
+
+            public bool Equals(IProgramDefinition other)
+            {
+                return this.ToString() == other.ToString();
+            }
+            public override bool Equals(object obj)
+            {
+                if (obj == null) { throw new ArgumentNullException("obj", "Object to compare cannot be null"); }
+                if (obj.GetType().IsAssignableFrom(typeof(IProgramDefinition)))
+                {
+                    return this.Equals((IProgramDefinition)obj);
+                }
+                return base.Equals(obj);
+            }
+            public override int GetHashCode()
+            {
+                return this.ToString().GetHashCode();
+            }
         }
         public ProgramList() { }
         //public object ConvertObjectData(object source) { return this.ConvertData(source); }

 

  ViewVC Help
Powered by ViewVC 1.1.22