/[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

--- trunk/libxmltv/Core/XMLTVLoader.cs	2013/03/08 02:13:59	36
+++ trunk/libxmltv/Core/XMLTVLoader.cs	2013/03/08 04:01:25	46
@@ -9,13 +9,17 @@
 
 namespace libxmltv.Core
 {   
-    internal class XMLTVLoader// : IXMLTV_LOADER
+    internal class XMLTVLoader : IDisposable
     {
         private string xmlfile = string.Empty;
+        internal static void CreateInstance(string xml_file, XMLTVRuntimeInstance xmltv)
+        {
+            using (XMLTVLoader g = new XMLTVLoader(xml_file, xmltv)) { }            
+        }
         private XMLTVRuntimeInstance instance;
-        public XMLTVLoader(string xml_file, XMLTVRuntimeInstance xmltv)
+        protected XMLTVLoader(string xml_file, XMLTVRuntimeInstance xmltv)
         {
-            XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("Creating Instance of XMLTVLoader");
+            xmltv_logger.Log.Verbose.Debug.WriteLine("Creating Instance of XMLTVLoader");
             //string _xmltv;
             //if (!Internals.VerifyInstance<string>(xmltv, out _xmltv)) { return; }
             //xmlfile = _xmltv;
@@ -31,17 +35,22 @@
 
         private void LoadXml()
         {
-            XMLTV_LOGGER.Log.Info.WriteLine("Loading XMLTV File: {0}", instance.XmlFile.Name);
-            //XMLTV_LOGGER.Log.Warn.WriteLine("XML File Loading has not been implemented yet!");
+            xmltv_logger.Log.Info.WriteLine("Loading XMLTV File: {0}", instance.XmlFile.Name);
+            //xmltv_logger.Log.Warn.WriteLine("XML File Loading has not been implemented yet!");
             try
             {
                 instance.XmlDoc = XDocument.Load(instance.XmlFile.FullName);
             }
             catch (Exception ex)
             {
-                XMLTV_LOGGER.Log.Error.WriteLine("Failed to load XMLTV File: {0}", instance.XmlFile.Name);
-                XMLTV_LOGGER.Log.Error.WriteLine(ex.GetBaseException().ToString());
+                xmltv_logger.Log.Error.WriteLine("Failed to load XMLTV File: {0}", instance.XmlFile.Name);
+                xmltv_logger.Log.Error.WriteLine(ex.GetBaseException().ToString());
             }
         }
+
+        public void Dispose()
+        {
+            //throw new NotImplementedException();
+        }
     }
 }

 

  ViewVC Help
Powered by ViewVC 1.1.22