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

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

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

--- trunk/libxmltv/Core/XMLTVSource.cs	2013/03/08 01:22:03	35
+++ trunk/libxmltv/Core/XMLTVSource.cs	2013/03/08 02:13:59	36
@@ -11,26 +11,28 @@
     internal class XMLTVSource : IXMLTVSource
     {
         private Dictionary<string, string> entries = new Dictionary<string, string>();
-        public XMLTVSource(object xmltv)
+        private XMLTVRuntimeInstance instance;
+        public XMLTVSource(XMLTVRuntimeInstance xmltv)
         {
             XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("Creating Instance of XMLTVSource");
-            IXMLTV_PARSER _xmltv;
-            if (!Internals.VerifyInstance<IXMLTV_PARSER>(xmltv, out _xmltv)) { return; }
-            XMLTV_PARSER = _xmltv;
+            //IXMLTV_PARSER _xmltv;
+            //if (!Internals.VerifyInstance<IXMLTV_PARSER>(xmltv, out _xmltv)) { return; }
+            //XMLTV_PARSER = _xmltv;
+            instance = xmltv;
             Create();
         }
        
         #region IXMLTVSource
-        private IXMLTV_PARSER XMLTV_PARSER { get; set; }
-        public string SourceName { get { return entries[XMLTV_CONSTANTS.Source.SourceName]; } }
-        public string GeneratorName { get { return entries[XMLTV_CONSTANTS.Source.GeneratorName]; } }
-        public string GeneratorUrl { get { return entries[XMLTV_CONSTANTS.Source.GeneratorUrl]; } }
+        //private IXMLTV_PARSER XMLTV_PARSER { get; set; }
+        public string SourceName { get { return entries[XMLTVConstants.Source.SourceName]; } }
+        public string GeneratorName { get { return entries[XMLTVConstants.Source.GeneratorName]; } }
+        public string GeneratorUrl { get { return entries[XMLTVConstants.Source.GeneratorUrl]; } }
         #endregion
 
         private void Create()
         {
-            var doc = XMLTV_PARSER.XMLTV_LOADER.XmlDoc;
-            Debug.Assert(doc.Root.Name == XMLTV_CONSTANTS.ROOT_ELEMENT, string.Format("Expected Root Element: '{0}' but read: '{1}'", XMLTV_CONSTANTS.ROOT_ELEMENT, doc.Root.Name));
+            var doc = instance.XmlDoc;
+            Debug.Assert(doc.Root.Name == XMLTVConstants.ROOT_ELEMENT, string.Format("Expected Root Element: '{0}' but read: '{1}'", XMLTVConstants.ROOT_ELEMENT, doc.Root.Name));
             XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("\tRoot: {0}", doc.Root.Name);
             var attributes = doc.Root.Attributes().ToList();
             foreach (var attribute in attributes)

 

  ViewVC Help
Powered by ViewVC 1.1.22