/[xmltv_parser]/trunk/GBPVRProgramDatabaseFixer/SQLLITE.cs
ViewVC logotype

Diff of /trunk/GBPVRProgramDatabaseFixer/SQLLITE.cs

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

--- trunk/GBPVRProgramDatabaseFixer/SQLLITE.cs	2013/03/17 02:47:23	223
+++ trunk/GBPVRProgramDatabaseFixer/SQLLITE.cs	2013/03/17 02:57:19	224
@@ -11,6 +11,10 @@
 using libxmltv.Core;
 namespace GBPVRProgramDatabaseFixer
 {
+    public interface ICloneable<T>
+    {
+        T Clone();
+    }
     public interface IOldNewProgram
     {
         SQLLITE.IPROGRAMME OldProgram { get; }
@@ -45,63 +49,7 @@
         }
 
         #region DATABASE DEFINITIONS
-
-        public interface ICHANNEL : ICloneable
-        {
-            Int64 oid { get; }
-            String name { get; }
-            String channelID { get; }
-            Int64 channel_number { get; }
-            String favourite_channel { get; }
-            String display_name { get; }
-        }
-        private class CHANNEL : ICHANNEL, ICloneable
-        {
-            public CHANNEL()
-            {
-                BaseDatabaseDefinition<CHANNEL>.CreateDefault(this);
-            }
-            //public RECORDING_SCHEDULE(SQLiteDataReader r, int index) { BaseDatabaseDefinition<RECORDING_SCHEDULE>.Create(this, r, index); }
-
-            public static void Create(ref CHANNEL instance, SQLiteDataReader r, int index)
-            {
-                BaseDatabaseDefinition<CHANNEL>.Create(ref instance, r, index);
-            }
-            #region ICHANNEL members
-            public Int64 oid { get; set; }
-            public String name { get; set; }
-            public String channelID { get; set; }
-            public Int64 channel_number { get; set; }
-            public String favourite_channel { get; set; }
-            public String display_name { get; set; }
-            #endregion
-
-            public object Clone()
-            {
-                CHANNEL p = new CHANNEL();
-                BaseDatabaseDefinition<CHANNEL>.Create(this, ref p);
-                return p;   
-            }
-        }
-        public interface IRECORDING_SCHEDULE : ICloneable
-        {
-            Int64 oid { get; }
-            Int64 programme_oid { get; }
-            Int64 capture_source_oid { get; }
-            Int16 status { get; }
-            String filename { get; }
-            Int64 recording_type { get; }
-            Int64 recording_group { get; }
-            DateTime manual_start_time { get; }
-            DateTime manual_end_time { get; }
-            Int64 manual_channel_oid { get; }
-            Int64 quality_level { get; }
-            Int64 pre_pad_minutes { get; }
-            Int64 post_pad_minutes { get; }
-            Int32 priority { get; }
-            String conversion_profile { get; }
-        }
-
+        #region BaseDatabaseDefinition
         private static class BaseDatabaseDefinition<T>
         {
             public static void CreateDefault(T instance)
@@ -197,8 +145,70 @@
 
             }
         }
+        #endregion
+        public interface ICHANNEL : ICloneable<ICHANNEL>
+        {
+            Int64 oid { get; }
+            String name { get; }
+            String channelID { get; }
+            Int64 channel_number { get; }
+            String favourite_channel { get; }
+            String display_name { get; }
+        }
+        private class CHANNEL : ICHANNEL, ICloneable<CHANNEL>
+        {
+            public CHANNEL()
+            {
+                BaseDatabaseDefinition<CHANNEL>.CreateDefault(this);
+            }
+            //public RECORDING_SCHEDULE(SQLiteDataReader r, int index) { BaseDatabaseDefinition<RECORDING_SCHEDULE>.Create(this, r, index); }
+
+            public static void Create(ref CHANNEL instance, SQLiteDataReader r, int index)
+            {
+                BaseDatabaseDefinition<CHANNEL>.Create(ref instance, r, index);
+            }
+            #region ICHANNEL members
+            public Int64 oid { get; set; }
+            public String name { get; set; }
+            public String channelID { get; set; }
+            public Int64 channel_number { get; set; }
+            public String favourite_channel { get; set; }
+            public String display_name { get; set; }
+            #endregion
+
+            ICHANNEL ICloneable<ICHANNEL>.Clone()
+            {
+                return Clone();
+            }
+            public CHANNEL Clone()
+            {
+                CHANNEL p = new CHANNEL();
+                BaseDatabaseDefinition<CHANNEL>.Create(this, ref p);
+                return p;
+            }
+        }
+        public interface IRECORDING_SCHEDULE : ICloneable<IRECORDING_SCHEDULE>
+        {
+            Int64 oid { get; }
+            Int64 programme_oid { get; }
+            Int64 capture_source_oid { get; }
+            Int16 status { get; }
+            String filename { get; }
+            Int64 recording_type { get; }
+            Int64 recording_group { get; }
+            DateTime manual_start_time { get; }
+            DateTime manual_end_time { get; }
+            Int64 manual_channel_oid { get; }
+            Int64 quality_level { get; }
+            Int64 pre_pad_minutes { get; }
+            Int64 post_pad_minutes { get; }
+            Int32 priority { get; }
+            String conversion_profile { get; }
+        }
 
-        private class RECORDING_SCHEDULE : IRECORDING_SCHEDULE, ICloneable
+
+
+        private class RECORDING_SCHEDULE : IRECORDING_SCHEDULE, ICloneable<RECORDING_SCHEDULE>
         {
             public RECORDING_SCHEDULE()
             {
@@ -210,11 +220,15 @@
             {
                 BaseDatabaseDefinition<RECORDING_SCHEDULE>.Create(ref instance, r, index);
             }
-            public object Clone()
+            IRECORDING_SCHEDULE ICloneable<IRECORDING_SCHEDULE>.Clone()
+            {
+                return Clone();
+            }
+            public RECORDING_SCHEDULE Clone()
             {
                 RECORDING_SCHEDULE p = new RECORDING_SCHEDULE();
                 BaseDatabaseDefinition<RECORDING_SCHEDULE>.Create(this, ref p);
-                return p;   
+                return p;
             }
             #region IRECORDING_SCHEDULE members
             public Int64 oid { get; set; }
@@ -237,7 +251,7 @@
             
         }
 
-        public interface IPROGRAMME : IEquatable<IPROGRAMME>, ICloneable
+        public interface IPROGRAMME : IEquatable<IPROGRAMME>, ICloneable<IPROGRAMME>
         {
             Int64 oid { get; set; }
             String name { get; set; }
@@ -252,16 +266,19 @@
             string ToString();
             IProgramDefinition AsXMLTVProgramDefinition(ISQLLITE sqllite);
         }
-        private class PROGRAMME : IPROGRAMME, ICloneable
+        private class PROGRAMME : IPROGRAMME, ICloneable<PROGRAMME>
         {
-
-            public object Clone()
+           
+            IPROGRAMME ICloneable<IPROGRAMME>.Clone()
+            {
+                return Clone();
+            }
+            public PROGRAMME Clone()
             {
                 PROGRAMME p = new PROGRAMME();
                 BaseDatabaseDefinition<PROGRAMME>.Create(this, ref p);
-                return p;   
+                return p; 
             }
-
             public PROGRAMME()
             {
                 BaseDatabaseDefinition<PROGRAMME>.CreateDefault(this);
@@ -333,7 +350,13 @@
                 return this.ToString().GetHashCode();
             }
 
-            
+
+
+
+
+
+
+          
         }
         #endregion
         private static class TABLES
@@ -419,7 +442,7 @@
                     if (!xmltv_entry.Equals(program_xmltv_entry))
                     {
                         // data is different                        
-                        var updated_program = (IPROGRAMME)program.Clone();
+                        var updated_program = program.Clone();
 
                         if (program_xmltv_entry.Title != xmltv_entry.Title)
                         {

 

  ViewVC Help
Powered by ViewVC 1.1.22