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 |
william |
45 |
internal class XMLTVRuntimeInstance : MarshalByRefObject, IXMLTVRuntimeInstance |
10 |
william |
36 |
{ |
11 |
|
|
public XMLTVRuntimeInstance(string xmlfile) { CreateInstance(xmlfile); } |
12 |
william |
45 |
private void CreateInstance(string xmlfile) |
13 |
|
|
{ |
14 |
|
|
using (Instance = new XMLTVInstance(xmlfile, this)) |
15 |
|
|
{ |
16 |
|
|
} |
17 |
|
|
} |
18 |
william |
36 |
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 |
william |
44 |
|
30 |
william |
45 |
//public void Dispose() |
31 |
|
|
//{ |
32 |
|
|
// IsDisposing = true; |
33 |
|
|
// //throw new NotImplementedException(); |
34 |
|
|
//} |
35 |
william |
44 |
public bool IsDisposing { get; private set; } |
36 |
william |
36 |
} |
37 |
|
|
|
38 |
william |
44 |
internal class XMLTVInstance : IDisposable |
39 |
william |
36 |
{ |
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 |
william |
44 |
//XMLTVLoader loader = new XMLTVLoader(xml_file, instance); |
49 |
|
|
XMLTVLoader.CreateInstance(xml_file, instance); |
50 |
william |
36 |
} |
51 |
|
|
private void CreateParser(XMLTVRuntimeInstance instance) |
52 |
|
|
{ |
53 |
william |
44 |
//XMLTVParser parser = new XMLTVParser(instance); |
54 |
|
|
XMLTVParser.CreateInstance(instance); |
55 |
william |
36 |
} |
56 |
william |
44 |
|
57 |
|
|
public void Dispose() |
58 |
|
|
{ |
59 |
|
|
//throw new NotImplementedException(); |
60 |
|
|
} |
61 |
william |
36 |
} |
62 |
|
|
} |