/[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 97 by william, Sun Mar 10 09:43:49 2013 UTC revision 120 by william, Sun Mar 10 18:19:12 2013 UTC
# Line 38  namespace libxmltv.Core Line 38  namespace libxmltv.Core
38          private void InternalDictionaryAddKnownProperties()          private void InternalDictionaryAddKnownProperties()
39          {          {
40              MetaData = new PropertyList();              MetaData = new PropertyList();
             //MetaData.AddProperty("Id", string.Empty);  
41          }          }
42          #region IXMLTVChannel members          #region IXMLTVChannel members
43          public string Id { get; private set; }          public string Id { get; private set; }
44          //public int Number { get; private set; }          //public int Number { get; private set; }
45          //public string CallSign { get; private set; }          //public string CallSign { get; private set; }
46          //public string Name { get; private set; }          //public string Name { get; private set; }
47          private PropertyList _MetaData;          private IPropertyList _MetaData;
48          public PropertyList MetaData { get { return _MetaData; } private set { _MetaData = value; } }          public IPropertyList MetaData { get { return _MetaData; } private set { _MetaData = value; } }
49          #endregion          #endregion
50          public override string ToString()          public override string ToString()
51          {          {
# Line 60  namespace libxmltv.Core Line 59  namespace libxmltv.Core
59              var fields = instance_type.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);              var fields = instance_type.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
60              foreach (var field in fields)              foreach (var field in fields)
61              {              {
62                  if (field.FieldType == typeof(List<IXMLTVChannel>))                  if (field.FieldType == typeof(ChannelList))
63                  {                  {
64                      found_field = true;                      found_field = true;
65                      try                      try
66                      {                      {
67                          var list = (List<IXMLTVChannel>)field.GetValue(this.GetInstance());                          var list = (ChannelList)field.GetValue(this.GetInstance());
68                          list.Add(this);                          list.Add(this);
69                          xmltv_logger.Verbose.Debug.WriteLine("Updating instance with channel information: {0}", this.ToString());                          xmltv_logger.Verbose.Debug.WriteLine("Updating instance with channel information: {0}", this.ToString());
70                          field.SetValue(this.GetInstance(), list);                          field.SetValue(this.GetInstance(), list);
# Line 90  namespace libxmltv.Core Line 89  namespace libxmltv.Core
89              // get the channel id              // get the channel id
90              Id = node.Attribute(XMLTVConstants.Channels.ChannelId).Value;              Id = node.Attribute(XMLTVConstants.Channels.ChannelId).Value;
91              xmltv_logger.Verbose.Debug.WriteLine("\tchannel_id: {0}", Id);              xmltv_logger.Verbose.Debug.WriteLine("\tchannel_id: {0}", Id);
92              var names = node.Descendants(XMLTVConstants.Channels.ChannelDisplayName).ToList();              var names = node.Elements().ToList();
             //Number = Convert.ToInt32(names[1].Value);  
             //xmltv_logger.Verbose.Debug.WriteLine("\tchannel_number: {0}", Number);  
             //CallSign = names[2].Value;  
             //xmltv_logger.Verbose.Debug.WriteLine("\tchannel_callsign: {0}", CallSign);  
             //Name = names[3].Value;  
             //xmltv_logger.Verbose.Debug.WriteLine("\tchannel_name: {0}", Name);  
93    
94              foreach (var name in names)              foreach (var name in names)
95              {              {

Legend:
Removed from v.97  
changed lines
  Added in v.120

  ViewVC Help
Powered by ViewVC 1.1.22