/[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/04/03 05:28:26	252
+++ trunk/libxmltv/Core/DataSourceBindable.cs	2013/04/17 21:55:30	254
@@ -24,6 +24,8 @@
             {
             }
             #endregion
+
+            
         }
         private class ChannelDefintion : IChannelDefintion
         {
@@ -48,6 +50,28 @@
                 }
                 return builder.ToString();
             }
+
+            private IXMLTVChannel _RawDataSource; public IXMLTVChannel RawDataSource { get { return _RawDataSource; } set { _RawDataSource = value; } }
+
+
+            public bool Equals(IChannelDefintion 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(IChannelDefintion)))
+                {
+                    return this.Equals((IChannelDefintion)obj);
+                }
+                return base.Equals(obj);
+            }
+            public override int GetHashCode()
+            {
+                return this.ToString().GetHashCode();
+            }
+
             
         }
         //static private List<string> known_columns;
@@ -84,6 +108,7 @@
                 try
                 {
                     ChannelDefintion definition = new ChannelDefintion();
+                    definition.RawDataSource = t;
                     definition.ChannelId = t.Id;
                     definition.ChannelName = t.MetaData[XMLTVConstants.Channels.ChannelDisplayName].FirstOrDefault().Value.ToString();
                     xmltv_logger.Verbose.Debug.WriteLine(definition.ToString());
@@ -183,6 +208,7 @@
                 if (list != null) { source = list; }
             }
             #endregion
+            
         }
         public class ProgramDefintion : IProgramDefinition, IEquatable<IProgramDefinition>
         {
@@ -221,6 +247,8 @@
                 return builder.ToString();
             }
 
+            private IXMLTVProgram _RawDataSource; public IXMLTVProgram RawDataSource { get { return _RawDataSource; } set { _RawDataSource = value; } }
+
             public bool Equals(IProgramDefinition other)
             {
                 return this.ToString() == other.ToString();
@@ -264,6 +292,7 @@
                 try
                 {
                     ProgramDefintion definition = new ProgramDefintion();
+                    definition.RawDataSource = t;
                     string ChannelId = t.MetaData[XMLTVConstants.Programs.ProgramChannelId].ToString();
                     //definition.ChannelId = ChannelId;
 

 

  ViewVC Help
Powered by ViewVC 1.1.22