ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/xmltv_parser/trunk/libxmltv/Core/XMLTVInstance.cs
Revision: 45
Committed: Fri Mar 8 03:41:18 2013 UTC (10 years, 6 months ago) by william
File size: 2012 byte(s)
Log Message:

File Contents

# Content
1 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)
13 {
14 using (Instance = new XMLTVInstance(xmlfile, this))
15 {
16 }
17 }
18 internal XMLTVInstance Instance { get; private set; }
19
20 #region IXMLTV_LOADER members
21 public System.IO.FileInfo XmlFile { get; set; }
22 public System.Xml.Linq.XDocument XmlDoc { get; set; }
23 #endregion
24 #region IXMLTV_PARSER Members
25 public IXMLTVSource Source { get; set; }
26 public Dictionary<string, IXMLTVChannel> Channels { get; set; }
27 public Dictionary<int, IXMLTVProgram> Programs { get; set; }
28 #endregion
29
30 //public void Dispose()
31 //{
32 // IsDisposing = true;
33 // //throw new NotImplementedException();
34 //}
35 public bool IsDisposing { get; private set; }
36 }
37
38 internal class XMLTVInstance : IDisposable
39 {
40 public XMLTVInstance(string xmlfile, XMLTVRuntimeInstance instance)
41 {
42 CreateLoader(xmlfile, instance);
43 CreateParser(instance);
44 }
45
46 private void CreateLoader(string xml_file, XMLTVRuntimeInstance instance)
47 {
48 //XMLTVLoader loader = new XMLTVLoader(xml_file, instance);
49 XMLTVLoader.CreateInstance(xml_file, instance);
50 }
51 private void CreateParser(XMLTVRuntimeInstance instance)
52 {
53 //XMLTVParser parser = new XMLTVParser(instance);
54 XMLTVParser.CreateInstance(instance);
55 }
56
57 public void Dispose()
58 {
59 //throw new NotImplementedException();
60 }
61 }
62 }