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

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

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

revision 27 by william, Thu Mar 7 12:11:41 2013 UTC revision 28 by william, Thu Mar 7 12:51:53 2013 UTC
# Line 35  namespace libxmltv.Core Line 35  namespace libxmltv.Core
35              foreach (var c in doc.Descendants(XMLTV_CONSTANTS.CHANNEL_ELEMENT))              foreach (var c in doc.Descendants(XMLTV_CONSTANTS.CHANNEL_ELEMENT))
36              {              {
37                  Channel channel = new Channel(c);                  Channel channel = new Channel(c);
38                  entries.Add(channel.ChannelId, channel);                  entries.Add(channel.Id, channel);
39              }              }
40          }          }
41          public override string ToString()          public override string ToString()
# Line 49  namespace libxmltv.Core Line 49  namespace libxmltv.Core
49      {      {
50          public Channel()          public Channel()
51          {          {
52              ChannelId = string.Empty;              Id = string.Empty;
53              ChannelNumber = 0;              Number = 0;
54              ChannelCallSign = string.Empty;              CallSign = string.Empty;
55              ChannelName = string.Empty;              Name = string.Empty;
56          }          }
57          public Channel(XElement e)          public Channel(XElement e)
58              : this()              : this()
59          {          {
60              // get the channel id              // get the channel id
61              ChannelId = e.Attribute(XMLTV_CONSTANTS.Channels.ChannelId).Value;              Id = e.Attribute(XMLTV_CONSTANTS.Channels.ChannelId).Value;
62              var names = e.Descendants(XMLTV_CONSTANTS.Channels.ChannelDisplayName).ToList();              var names = e.Descendants(XMLTV_CONSTANTS.Channels.ChannelDisplayName).ToList();
63              ChannelNumber = Convert.ToInt32(names[1].Value);              Number = Convert.ToInt32(names[1].Value);
64              ChannelCallSign = names[2].Value;              CallSign = names[2].Value;
65              ChannelName = names[3].Value;              Name = names[3].Value;
66          }          }
67          #region IXMLTVChannel members          #region IXMLTVChannel members
68          public string ChannelId { get; private set; }          public string Id { get; private set; }
69          public int ChannelNumber { get; private set; }          public int Number { get; private set; }
70          public string ChannelCallSign { get; private set; }          public string CallSign { get; private set; }
71          public string ChannelName { get; private set; }          public string Name { get; private set; }
72          #endregion          #endregion
73            public override string ToString()
74            {
75                return string.Format("{0}: {1} {2} ({3})", Id,Number,Name, CallSign);
76            }
77      }      }
78  }  }
79    

Legend:
Removed from v.27  
changed lines
  Added in v.28

  ViewVC Help
Powered by ViewVC 1.1.22