ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/xmltv_parser/trunk/libxmltv/Core/XMLTVInstance.cs
Revision: 36
Committed: Fri Mar 8 02:13:59 2013 UTC (10 years, 9 months ago) by william
File size: 1497 byte(s)
Log Message:
+ use a MarshalByRefObject

File Contents

# User Rev Content
1 william 36 using System;
2     using System.Collections.Generic;
3     using System.Linq;
4     using System.Text;
5     using libxmltv.Interfaces;
6    
7     namespace libxmltv.Core
8     {
9     internal class XMLTVRuntimeInstance : MarshalByRefObject, IXMLTVRuntimeInstance
10     {
11     public XMLTVRuntimeInstance(string xmlfile) { CreateInstance(xmlfile); }
12     private void CreateInstance(string xmlfile) { Instance = new XMLTVInstance(xmlfile, this); }
13     internal XMLTVInstance Instance { get; private set; }
14    
15     #region IXMLTV_LOADER members
16     public System.IO.FileInfo XmlFile { get; set; }
17     public System.Xml.Linq.XDocument XmlDoc { get; set; }
18     #endregion
19     #region IXMLTV_PARSER Members
20     public IXMLTVSource Source { get; set; }
21     public Dictionary<string, IXMLTVChannel> Channels { get; set; }
22     public Dictionary<int, IXMLTVProgram> Programs { get; set; }
23     #endregion
24     }
25    
26     internal class XMLTVInstance
27     {
28     public XMLTVInstance(string xmlfile, XMLTVRuntimeInstance instance)
29     {
30     CreateLoader(xmlfile, instance);
31     CreateParser(instance);
32     }
33    
34     private void CreateLoader(string xml_file, XMLTVRuntimeInstance instance)
35     {
36     XMLTVLoader loader = new XMLTVLoader(xml_file, instance);
37     }
38     private void CreateParser(XMLTVRuntimeInstance instance)
39     {
40     XMLTVParser parser = new XMLTVParser(instance);
41     }
42     }
43     }