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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 36 - (hide annotations) (download)
Fri Mar 8 02:13:59 2013 UTC (7 years, 7 months ago) by william
File size: 1678 byte(s)
+ use a MarshalByRefObject

1 william 11 using System;
2     using System.Collections.Generic;
3     using System.Linq;
4     using System.Text;
5     using libxmltv.Interfaces;
6     using System.IO;
7 william 14 using Enterprise.Logging;
8 william 19 using System.Xml.Linq;
9 william 11
10     namespace libxmltv.Core
11 william 22 {
12 william 36 internal class XMLTVLoader// : IXMLTV_LOADER
13 william 11 {
14     private string xmlfile = string.Empty;
15 william 36 private XMLTVRuntimeInstance instance;
16     public XMLTVLoader(string xml_file, XMLTVRuntimeInstance xmltv)
17 william 11 {
18 william 36 XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("Creating Instance of XMLTVLoader");
19     //string _xmltv;
20     //if (!Internals.VerifyInstance<string>(xmltv, out _xmltv)) { return; }
21     //xmlfile = _xmltv;
22     //LoadXml();
23     instance = xmltv;
24     instance.XmlFile = new FileInfo(xml_file);
25 william 16 LoadXml();
26 william 11 }
27 william 36 //#region IXMLTV_LOADER
28     //public FileInfo XmlFile { get { return new FileInfo(xmlfile); } }
29     //public XDocument XmlDoc { get; private set; }
30     //#endregion
31 william 16
32     private void LoadXml()
33     {
34 william 36 XMLTV_LOGGER.Log.Info.WriteLine("Loading XMLTV File: {0}", instance.XmlFile.Name);
35 william 19 //XMLTV_LOGGER.Log.Warn.WriteLine("XML File Loading has not been implemented yet!");
36 william 21 try
37     {
38 william 36 instance.XmlDoc = XDocument.Load(instance.XmlFile.FullName);
39 william 21 }
40     catch (Exception ex)
41     {
42 william 36 XMLTV_LOGGER.Log.Error.WriteLine("Failed to load XMLTV File: {0}", instance.XmlFile.Name);
43 william 21 XMLTV_LOGGER.Log.Error.WriteLine(ex.GetBaseException().ToString());
44     }
45 william 16 }
46 william 11 }
47     }

  ViewVC Help
Powered by ViewVC 1.1.22