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

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

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

--- trunk/libxmltv/Core/XMLTVChannel.cs	2013/03/09 11:28:41	77
+++ trunk/libxmltv/Core/XMLTVChannel.cs	2013/03/09 14:52:10	88
@@ -5,13 +5,16 @@
 using libxmltv.Interfaces;
 using System.Xml.Linq;
 using System.Reflection;
+using System.IO;
+using System.Diagnostics;
 
 namespace libxmltv.Core
 {
     [Serializable]
     internal class XMLTVChannel : XMLTVBase<XMLTVRuntimeInstance>, IXMLTVChannel
     {
-        public XMLTVChannel() : base(null,XMLTVConstants.CHANNEL_ELEMENT)
+        public XMLTVChannel()
+            : base(null, XMLTVConstants.Channels.RootElement)
         {
             Id = string.Empty;
             Number = 0;
@@ -19,12 +22,16 @@
             Name = string.Empty;
         }
         public XMLTVChannel(XMLTVRuntimeInstance instance, XElement node)
-            : base(instance, XMLTVConstants.CHANNEL_ELEMENT)
+            : base(instance, XMLTVConstants.Channels.RootElement)
         {
-            xmltv_logger.Verbose.Debug.WriteLine("Creating Instance of XMLTVChannel");
-            Create(node);
-            xmltv_logger.Verbose.Debug.WriteLine("Created Instance of XMLTVChannel");
-            UpdateInstance();            
+            try
+            {
+                xmltv_logger.Verbose.Debug.WriteLine("Creating Instance of XMLTVChannel");
+                Create(node);
+                xmltv_logger.Verbose.Debug.WriteLine("Created Instance of XMLTVChannel");
+                UpdateInstance();
+            }
+            catch (IOException ex) { Debug.WriteLine(ex.ToString()); }
         }
         #region IXMLTVChannel members
         public string Id { get; private set; }
@@ -48,7 +55,7 @@
                 {
                     found_field = true;
                     try
-                    {                                                
+                    {
                         var list = (List<IXMLTVChannel>)field.GetValue(this.GetInstance());
                         list.Add(this);
                         xmltv_logger.Verbose.Debug.WriteLine("Updating instance with channel information: {0}", this.ToString());

 

  ViewVC Help
Powered by ViewVC 1.1.22