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

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

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

--- trunk/libxmltv/Core/XMLTV_PARSER.cs	2013/03/07 11:08:48	23
+++ trunk/libxmltv/Core/XMLTV_PARSER.cs	2013/03/07 11:36:00	25
@@ -1,4 +1,4 @@
-#define XMLTV_PARSER_TESTING // when defined will allow calls to be made to _imp_TestParse()
+//#define XMLTV_PARSER_TESTING // when defined will allow calls to be made to _imp_TestParse()
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -17,10 +17,12 @@
             IXMLTV_LOADER _xmltv;
             if (!Internals.VerifyInstance<IXMLTV_LOADER>(xmltv, out _xmltv)) { return; }
             XMLTV_LOADER = _xmltv;
+            Create();
         }
         #region IXMLTV_PARSER members
         public IXMLTV_LOADER XMLTV_LOADER { get; private set; }
         public void TestParse() { _imp_TestParse(); }
+        public IXMLTVSource Source { get; private set; }
         #endregion
 
         #region Parser Testing Methods
@@ -76,6 +78,41 @@
         private void ParsePrograms(XDocument doc)
         {
             XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("Parsing Program Data");
+            var elements = doc.Root.Descendants(XMLTV_CONSTANTS.PROGRAM_ELEMENT).ToList();
+            foreach (var element in elements)
+            {
+                if (element.HasAttributes)
+                {
+                    foreach (var attribute in element.Attributes())
+                    {
+                        XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("\t\t{0} {1}: {2}", element.Name, attribute.Name, attribute.Value);
+                    }
+                }
+                foreach (var childEllement in element.Descendants())
+                {
+                    if (childEllement.HasAttributes)
+                    {
+                        foreach (var attribute in childEllement.Attributes())
+                        {
+                            XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("\t\t\t{0}: {1}", attribute.Name, attribute.Value);
+                        }
+                    }
+                    XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("\t\t\t{0}: {1}", childEllement.Name, childEllement.Value);
+                }
+                //break;
+            }
+        }
+        #endregion
+
+        #region Creation Methods
+        private void Create()
+        {
+            CreateXMLTVSource();
+        }
+        private void CreateXMLTVSource()
+        {
+            XMLTVSource source = new XMLTVSource(this);
+            Source = source;
         }
         #endregion
     }

 

  ViewVC Help
Powered by ViewVC 1.1.22