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

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

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

revision 111 by william, Sun Mar 10 15:37:16 2013 UTC revision 191 by william, Sat Mar 16 20:07:53 2013 UTC
# Line 10  using System.Reflection; Line 10  using System.Reflection;
10  using System.Globalization;  using System.Globalization;
11  using System.Diagnostics;  using System.Diagnostics;
12  using System.Xml.Linq;  using System.Xml.Linq;
13    using Enterprise.Logging;
14    using System.IO;
15    
16  namespace libxmltv.Core  namespace libxmltv.Core
17  {  {
# Line 49  namespace libxmltv.Core Line 51  namespace libxmltv.Core
51          private void init()          private void init()
52          {          {
53              this.Source = new XMLTVSource();              this.Source = new XMLTVSource();
54              this.Channels = new List<IXMLTVChannel>();              this.Channels = new ChannelList();
55              this.Programs = new List<IXMLTVProgram>();              this.Programs = new ProgramList();
56              this.XmlFile_Name = string.Empty;              this.XmlFile_Name = string.Empty;
57              this.XmlFile_FullName = string.Empty;              this.XmlFile_FullName = string.Empty;
58              this.XmlDoc = string.Empty;              this.XmlDoc = string.Empty;
59              this.OnInstanceCreated = null;              this.OnInstanceCreated = null;
60              this.ExtraEntries = new List<IExtraMetaData>();              this.ExtraEntries = new ExtraList();
61          }          }
62    
63          #region IXMLTVRuntimeInstance members          #region IXMLTVRuntimeInstance members
# Line 72  namespace libxmltv.Core Line 74  namespace libxmltv.Core
74          public string XmlDoc { get { return _XmlDoc; } set { _XmlDoc = value; } }          public string XmlDoc { get { return _XmlDoc; } set { _XmlDoc = value; } }
75          private IXMLTVSource _Source;          private IXMLTVSource _Source;
76          public IXMLTVSource Source { get { return _Source; } set { _Source = value; } }          public IXMLTVSource Source { get { return _Source; } set { _Source = value; } }
77          private List<IXMLTVChannel> _Channels;          private ChannelList _Channels;
78          public List<IXMLTVChannel> Channels { get { return _Channels; } set { _Channels = value; } }          public ChannelList Channels { get { return _Channels; } set { _Channels = value; } }
79          private List<IXMLTVProgram> _Programs;          private ProgramList _Programs;
80          public List<IXMLTVProgram> Programs { get { return _Programs; } set { _Programs = value; } }          public ProgramList Programs { get { return _Programs; } set { _Programs = value; } }
81    
82          private List<IExtraMetaData> _ExtraEntries;          private ExtraList _ExtraEntries;
83          public List<IExtraMetaData> ExtraEntries { get { return _ExtraEntries; } set { _ExtraEntries = value; } }          public ExtraList ExtraEntries { get { return _ExtraEntries; } set { _ExtraEntries = value; } }
84          #endregion                #endregion      
85          #region IOnInstanceCreated members          #region IOnInstanceCreated members
86          [NonSerialized]          [NonSerialized]
# Line 136  namespace libxmltv.Core Line 138  namespace libxmltv.Core
138              }              }
139              if (this.Channels != null)              if (this.Channels != null)
140              {              {
141                  xmltv_logger.Info.WriteLine("Source Loaded: '{0}' Channels from source '{1}'", this.Channels.Count, this.Source.SourceName);                  this.Channels.TrimExcess();
142                    xmltv_logger.Info.WriteLine("Source Loaded: '{0}' Channels from source '{1}'", this.Channels.ToArray().Count(), this.Source.SourceName);
143              }              }
144              else              else
145              {              {
# Line 145  namespace libxmltv.Core Line 148  namespace libxmltv.Core
148              }              }
149              if (this.Programs != null)              if (this.Programs != null)
150              {              {
151                  xmltv_logger.Info.WriteLine("Source Loaded: '{0}' Programs from source '{1}'", this.Programs.Count, this.Source.SourceName);                  this.Programs.TrimExcess();
152                    xmltv_logger.Info.WriteLine("Source Loaded: '{0}' Programs from source '{1}'", this.Programs.ToArray().Count(), this.Source.SourceName);
153              }              }
154              else              else
155              {              {
# Line 310  namespace libxmltv.Core Line 314  namespace libxmltv.Core
314                  if (!CreateHandlerForNode(node)) { xmltv_logger.Verbose.Debug.WriteLine("Unable to create handler for node: '{0}'", node.Name.ToString()); }                  if (!CreateHandlerForNode(node)) { xmltv_logger.Verbose.Debug.WriteLine("Unable to create handler for node: '{0}'", node.Name.ToString()); }
315                  node_index++;                  node_index++;
316                  progress = 100.0 * (node_index / total_nodes);                  progress = 100.0 * (node_index / total_nodes);
317                  xmltv_logger.ReportProgress(this, new Enterprise.Logging.ReportProgressEventArgs((int)progress));                  xmltv_logger.ReportProgress(this, new ReportProgressEventArgs((int)progress, string.Format("Loading {0} ==> {1:00}%", this.gInstance.XmlFile_Name, (int)progress)));
318                  Application.DoEvents();                  Application.DoEvents();
319              }              }
320          }          }

Legend:
Removed from v.111  
changed lines
  Added in v.191

  ViewVC Help
Powered by ViewVC 1.1.22