ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/xmltv_parser/trunk/libxmltv/Core/XMLTVInstance.cs
(Generate patch)

Comparing trunk/libxmltv/Core/XMLTVInstance.cs (file contents):
Revision 36 by william, Fri Mar 8 02:13:59 2013 UTC vs.
Revision 44 by william, Fri Mar 8 03:36:44 2013 UTC

--- trunk/libxmltv/Core/XMLTVInstance.cs	2013/03/08 02:13:59	36
+++ trunk/libxmltv/Core/XMLTVInstance.cs	2013/03/08 03:36:44	44
@@ -6,7 +6,7 @@ using libxmltv.Interfaces;
 
 namespace libxmltv.Core
 {
-    internal class XMLTVRuntimeInstance : MarshalByRefObject, IXMLTVRuntimeInstance
+    internal class XMLTVRuntimeInstance : MarshalByRefObject, IXMLTVRuntimeInstance, IDisposable
     {
         public XMLTVRuntimeInstance(string xmlfile) { CreateInstance(xmlfile); }
         private void CreateInstance(string xmlfile) { Instance = new XMLTVInstance(xmlfile, this); }
@@ -21,9 +21,16 @@ namespace libxmltv.Core
         public Dictionary<string, IXMLTVChannel> Channels { get; set; }
         public Dictionary<int, IXMLTVProgram> Programs { get; set; }
         #endregion   
+    
+        public void Dispose()
+        {
+            IsDisposing = true;
+            //throw new NotImplementedException();
+        }
+        public bool IsDisposing { get; private set; }
     }
 
-    internal class XMLTVInstance
+    internal class XMLTVInstance : IDisposable
     {
         public XMLTVInstance(string xmlfile, XMLTVRuntimeInstance instance) 
         { 
@@ -33,11 +40,18 @@ namespace libxmltv.Core
 
         private void CreateLoader(string xml_file, XMLTVRuntimeInstance instance)
         {
-            XMLTVLoader loader = new XMLTVLoader(xml_file, instance);
+            //XMLTVLoader loader = new XMLTVLoader(xml_file, instance);
+            XMLTVLoader.CreateInstance(xml_file, instance);
         }
         private void CreateParser(XMLTVRuntimeInstance instance)
         {
-            XMLTVParser parser = new XMLTVParser(instance);
+            //XMLTVParser parser = new XMLTVParser(instance);
+            XMLTVParser.CreateInstance(instance);
+        }
+
+        public void Dispose()
+        {
+            //throw new NotImplementedException();
         }
     }
 }