/[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 74 by william, Sat Mar 9 11:06:39 2013 UTC revision 76 by william, Sat Mar 9 11:23:09 2013 UTC
# Line 118  namespace libxmltv.Core Line 118  namespace libxmltv.Core
118              {              {
119                  throw new NullReferenceException("Failed to load from instance because the instance is null.");                  throw new NullReferenceException("Failed to load from instance because the instance is null.");
120              }              }
             CloneFromInstance(ref instance);  
121              xmltv_logger.Debug.WriteLine("Loading from instance...");              xmltv_logger.Debug.WriteLine("Loading from instance...");
122                CloneFromInstance(ref instance);            
123                xmltv_logger.Debug.WriteLine("Loaded from instance...");
124              if (this.Source != null)              if (this.Source != null)
125              {              {
126                  xmltv_logger.Info.WriteLine("Source Loaded: '{0}' Created by '{1}' - original source file: '{2}'", this.Source.FirstOrDefault().SourceName, this.Source.FirstOrDefault().GeneratorName, this.XmlFile_FullName);                  xmltv_logger.Info.WriteLine("Source Loaded: '{0}' Created by '{1}' - original source file: '{2}'", this.Source.FirstOrDefault().SourceName, this.Source.FirstOrDefault().GeneratorName, this.XmlFile_FullName);
# Line 146  namespace libxmltv.Core Line 147  namespace libxmltv.Core
147              {              {
148                  xmltv_logger.Error.WriteLine("Programs Property is null.");                  xmltv_logger.Error.WriteLine("Programs Property is null.");
149                  throw new NullReferenceException("Programs Property is null.");                  throw new NullReferenceException("Programs Property is null.");
150              }              }            
             xmltv_logger.Debug.WriteLine("Loaded from instance...");  
151              return instance;              return instance;
152          }          }
153          #endregion          #endregion
# Line 275  namespace libxmltv.Core Line 275  namespace libxmltv.Core
275          private void CreateParser()          private void CreateParser()
276          {          {
277              var doc = XDocument.Parse(this.GetInstance().XmlDoc);              var doc = XDocument.Parse(this.GetInstance().XmlDoc);
278              var root_element = doc.Root;              var root_element = doc.Root;            
               
279              CreateHandlerForRootNode(root_element);              CreateHandlerForRootNode(root_element);
   
280              var nodes = doc.Root.Elements().ToList();              var nodes = doc.Root.Elements().ToList();
281    
282                double total_nodes = nodes.Count;
283                double node_index = 0;
284                double progress = 0;
285              foreach(var node in nodes)              foreach(var node in nodes)
286              {              {
287                  if (!CreateHandlerForNode(node))                  if (!CreateHandlerForNode(node)) { xmltv_logger.Verbose.Debug.WriteLine("Unable to create handler for node: '{0}'", node.Name.ToString()); }
288                  {                  node_index++;
289                      xmltv_logger.Verbose.Debug.WriteLine("Unable to create handler for node: '{0}'", node.Name.ToString());                  progress = 100.0 * (node_index / total_nodes);
290                  }                  xmltv_logger.ReportProgress(this, new Enterprise.Logging.ReportProgressEventArgs((int)progress));
291                    Application.DoEvents();
292              }              }
293          }          }
294    

Legend:
Removed from v.74  
changed lines
  Added in v.76

  ViewVC Help
Powered by ViewVC 1.1.22