/[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

revision 77 by william, Sat Mar 9 11:28:41 2013 UTC revision 78 by william, Sat Mar 9 11:36:24 2013 UTC
# Line 5  using System.Text; Line 5  using System.Text;
5  using libxmltv.Interfaces;  using libxmltv.Interfaces;
6  using System.Xml.Linq;  using System.Xml.Linq;
7  using System.Reflection;  using System.Reflection;
8    using System.IO;
9    using System.Diagnostics;
10    
11  namespace libxmltv.Core  namespace libxmltv.Core
12  {  {
# Line 21  namespace libxmltv.Core Line 23  namespace libxmltv.Core
23          public XMLTVChannel(XMLTVRuntimeInstance instance, XElement node)          public XMLTVChannel(XMLTVRuntimeInstance instance, XElement node)
24              : base(instance, XMLTVConstants.CHANNEL_ELEMENT)              : base(instance, XMLTVConstants.CHANNEL_ELEMENT)
25          {          {
26              xmltv_logger.Verbose.Debug.WriteLine("Creating Instance of XMLTVChannel");              try
27              Create(node);              {
28              xmltv_logger.Verbose.Debug.WriteLine("Created Instance of XMLTVChannel");                  xmltv_logger.Verbose.Debug.WriteLine("Creating Instance of XMLTVChannel");
29              UpdateInstance();                              Create(node);
30                    xmltv_logger.Verbose.Debug.WriteLine("Created Instance of XMLTVChannel");
31                    UpdateInstance();
32                }
33                catch (IOException ex) { Debug.WriteLine(ex.ToString()); }
34          }          }
35          #region IXMLTVChannel members          #region IXMLTVChannel members
36          public string Id { get; private set; }          public string Id { get; private set; }
# Line 69  namespace libxmltv.Core Line 75  namespace libxmltv.Core
75          }          }
76    
77          private void Create(XElement node)          private void Create(XElement node)
78          {          {          
79              // get the channel id                  // get the channel id
80              Id = node.Attribute(XMLTVConstants.Channels.ChannelId).Value;                  Id = node.Attribute(XMLTVConstants.Channels.ChannelId).Value;
81              xmltv_logger.Verbose.Debug.WriteLine("\tchannel_id: {0}", Id);                  xmltv_logger.Verbose.Debug.WriteLine("\tchannel_id: {0}", Id);
82              var names = node.Descendants(XMLTVConstants.Channels.ChannelDisplayName).ToList();                  var names = node.Descendants(XMLTVConstants.Channels.ChannelDisplayName).ToList();
83              Number = Convert.ToInt32(names[1].Value);                  Number = Convert.ToInt32(names[1].Value);
84              xmltv_logger.Verbose.Debug.WriteLine("\tchannel_number: {0}", Number);                  xmltv_logger.Verbose.Debug.WriteLine("\tchannel_number: {0}", Number);
85              CallSign = names[2].Value;                  CallSign = names[2].Value;
86              xmltv_logger.Verbose.Debug.WriteLine("\tchannel_callsign: {0}", CallSign);                  xmltv_logger.Verbose.Debug.WriteLine("\tchannel_callsign: {0}", CallSign);
87              Name = names[3].Value;                  Name = names[3].Value;
88              xmltv_logger.Verbose.Debug.WriteLine("\tchannel_name: {0}", Name);                  xmltv_logger.Verbose.Debug.WriteLine("\tchannel_name: {0}", Name);          
89          }          }
90      }      }
91    

Legend:
Removed from v.77  
changed lines
  Added in v.78

  ViewVC Help
Powered by ViewVC 1.1.22