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

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

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

revision 14 by william, Thu Mar 7 09:05:18 2013 UTC revision 21 by william, Thu Mar 7 10:04:58 2013 UTC
# Line 5  using System.Text; Line 5  using System.Text;
5  using libxmltv.Interfaces;  using libxmltv.Interfaces;
6  using System.IO;  using System.IO;
7  using Enterprise.Logging;  using Enterprise.Logging;
8    using System.Xml.Linq;
9    
10  namespace libxmltv.Core  namespace libxmltv.Core
11  {  {
# Line 15  namespace libxmltv.Core Line 16  namespace libxmltv.Core
16      {      {
17          public static object CreateLoader(string xml_file)          public static object CreateLoader(string xml_file)
18          {          {
19              xmltv_logger.Initialize();              XMLTV_LOGGER.Initialize();
             xmltv_logger.Log.Debug.WriteLine("Logged from XMLTV.CreateLoader");  
20              XMLTV_LOADER loader = new XMLTV_LOADER(xml_file);              XMLTV_LOADER loader = new XMLTV_LOADER(xml_file);
21              return loader;              return loader;
22          }          }
# Line 47  namespace libxmltv.Core Line 47  namespace libxmltv.Core
47          private string xmlfile = string.Empty;          private string xmlfile = string.Empty;
48          public XMLTV_LOADER(string xml_file)          public XMLTV_LOADER(string xml_file)
49          {          {
50              xmlfile = xml_file;                          xmlfile = xml_file;
51                LoadXml();
52          }          }
53          #region IXMLTV_LOADER          #region IXMLTV_LOADER
54          public FileInfo XmlFile { get { return new FileInfo(xmlfile); } }          public FileInfo XmlFile { get { return new FileInfo(xmlfile); } }
55          #endregion          #endregion
56    
57            private void LoadXml()
58            {
59                XMLTV_LOGGER.Log.Info.WriteLine("Loading XMLTV File: {0}", XmlFile.Name);
60                //XMLTV_LOGGER.Log.Warn.WriteLine("XML File Loading has not been implemented yet!");
61                try
62                {
63                    XDocument doc = XDocument.Load(XmlFile.FullName);
64                }
65                catch (Exception ex)
66                {
67                    XMLTV_LOGGER.Log.Error.WriteLine("Failed to load XMLTV File: {0}", XmlFile.Name);
68                    XMLTV_LOGGER.Log.Error.WriteLine(ex.GetBaseException().ToString());
69                }
70            }
71      }      }
72  }  }

Legend:
Removed from v.14  
changed lines
  Added in v.21

  ViewVC Help
Powered by ViewVC 1.1.22