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

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

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

--- trunk/libxmltv/Core/XMLTVParser.cs	2013/03/08 10:19:32	55
+++ trunk/libxmltv/Core/XMLTVParser.cs	2013/03/08 13:40:32	59
@@ -21,100 +21,10 @@
 
         protected XMLTVParser(XMLTVRuntimeInstance xmltv)
         {
-            xmltv_logger.Verbose.Debug.WriteLine("Creating Instance of XMLTVParser");
-            //IXMLTV_LOADER _xmltv;
-            //if (!Internals.VerifyInstance<IXMLTV_LOADER>(xmltv, out _xmltv)) { return; }
-            //XMLTV_LOADER = _xmltv;
-            //Create();
+            xmltv_logger.Info.WriteLine("Creating Instance of XMLTVParser");
             instance = 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; }
-        //public Dictionary<string, IXMLTVChannel> Channels { get; private set; }
-        //public Dictionary<int, IXMLTVProgram> Programs { get; private set; }
-        #endregion
-
-        #region Parser Testing Methods
-        [Conditional("XMLTV_PARSER_TESTING")]
-        private void _imp_TestParse()
-        {
-            xmltv_logger.Verbose.Debug.WriteLine("Running XML_PARSER Test");
-            var doc = XDocument.Parse(instance.XmlDoc);
-            ParseRootElements(doc);
-            ParseChannels(doc);
-            ParsePrograms(doc);
-        }
-        [Conditional("XMLTV_PARSER_TESTING")]
-        private void ParseRootElements(XDocument doc)
-        {
-            xmltv_logger.Verbose.Debug.WriteLine("Parseing Root Data");            
-            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.Verbose.Debug.WriteLine("\tRoot: {0}", doc.Root.Name);
-            var attributes = doc.Root.Attributes().ToList();
-            foreach (var attribute in attributes)
-            {
-                xmltv_logger.Verbose.Debug.WriteLine("\t{0}: {1}", attribute.Name, attribute.Value);
-            }
-        }
-        [Conditional("XMLTV_PARSER_TESTING")]
-        private void ParseChannels(XDocument doc)
-        {
-            xmltv_logger.Verbose.Debug.WriteLine("Parsing Channel Data");
-            var elements = doc.Root.Descendants(XMLTVConstants.CHANNEL_ELEMENT).ToList();
-            foreach (var element in elements)
-            {
-                if (element.HasAttributes)
-                {
-                    foreach (var attribute in element.Attributes())
-                    {
-                        xmltv_logger.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.Verbose.Debug.WriteLine("\t\t\t{0}: {1}", attribute.Name, attribute.Value);
-                        }
-                    }
-                    xmltv_logger.Verbose.Debug.WriteLine("\t\t\t{0}: {1}", childEllement.Name, childEllement.Value);
-                }
-            }
-        }
-        [Conditional("XMLTV_PARSER_TESTING")]
-        private void ParsePrograms(XDocument doc)
-        {
-            xmltv_logger.Verbose.Debug.WriteLine("Parsing Program Data");
-            var elements = doc.Root.Descendants(XMLTVConstants.PROGRAM_ELEMENT).ToList();
-            foreach (var element in elements)
-            {
-                if (element.HasAttributes)
-                {
-                    foreach (var attribute in element.Attributes())
-                    {
-                        xmltv_logger.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.Verbose.Debug.WriteLine("\t\t\t{0}: {1}", attribute.Name, attribute.Value);
-                        }
-                    }
-                    xmltv_logger.Verbose.Debug.WriteLine("\t\t\t{0}: {1}", childEllement.Name, childEllement.Value);
-                }
-                //break;
-            }
-        }
-        #endregion
 
         #region Creation Methods
         private void Create()
@@ -125,20 +35,14 @@
         }
         private void CreateXMLTVSource()
         {
-            //XMLTVSource source = new XMLTVSource(instance);
-            //instance.Source = source;
             XMLTVSource.CreateInstance(instance);
         }
         private void CreateXMLTVChannels()
-        {
-            //XMLTVChannelCollection channels = new XMLTVChannelCollection(instance);
-            //instance.Channels = channels.Collection;            
+        {           
             XMLTVChannelCollection.CreateInstance(instance);
         }
         private void CreateXMLTVPrograms()
         {
-            //XMLTVProgramCollection programs = new XMLTVProgramCollection(instance);
-            //instance.Programs = programs.Collection;
             XMLTVProgramCollection.CreateInstance(instance);
         }
         #endregion

 

  ViewVC Help
Powered by ViewVC 1.1.22