1 |
william |
10 |
using System; |
2 |
|
|
using System.Collections.Generic; |
3 |
|
|
using System.Linq; |
4 |
|
|
using System.Text; |
5 |
william |
11 |
using System.IO; |
6 |
william |
22 |
using System.Xml.Linq; |
7 |
william |
26 |
using libxmltv.Core; |
8 |
william |
54 |
using System.ComponentModel; |
9 |
william |
10 |
|
10 |
|
|
namespace libxmltv.Interfaces |
11 |
|
|
{ |
12 |
william |
45 |
public interface IXMLTVLoader |
13 |
william |
11 |
{ |
14 |
|
|
FileInfo XmlFile { get; } |
15 |
william |
49 |
string XmlDoc { get; } |
16 |
william |
11 |
} |
17 |
william |
45 |
public interface IXMLTVParser |
18 |
william |
22 |
{ |
19 |
william |
36 |
//IXMLTV_LOADER XMLTV_LOADER { get; } |
20 |
|
|
//void TestParse(); |
21 |
william |
25 |
IXMLTVSource Source { get; } |
22 |
william |
26 |
Dictionary<string, IXMLTVChannel> Channels { get; } |
23 |
william |
27 |
Dictionary<int, IXMLTVProgram> Programs { get; } |
24 |
william |
22 |
} |
25 |
william |
25 |
|
26 |
|
|
public interface IXMLTVSource |
27 |
|
|
{ |
28 |
|
|
string SourceName { get; } |
29 |
|
|
string GeneratorName { get; } |
30 |
|
|
string GeneratorUrl { get; } |
31 |
|
|
string ToString(); |
32 |
|
|
} |
33 |
william |
26 |
public interface IXMLTVChannel |
34 |
|
|
{ |
35 |
william |
28 |
string Id { get; } |
36 |
|
|
int Number { get; } |
37 |
|
|
string CallSign { get; } |
38 |
|
|
string Name { get; } |
39 |
|
|
string ToString(); |
40 |
william |
31 |
} |
41 |
william |
27 |
public interface IXMLTVProgram |
42 |
|
|
{ |
43 |
william |
28 |
int Id { get; } |
44 |
|
|
DateTime Start { get; } |
45 |
|
|
DateTime Stop { get; } |
46 |
|
|
IXMLTVChannel Channel { get; } |
47 |
|
|
string Title { get; } |
48 |
|
|
string SubTitle { get; } |
49 |
|
|
string Description { get; } |
50 |
|
|
string ToString(); |
51 |
william |
27 |
} |
52 |
william |
45 |
public interface IXMLTVRuntimeInstance : IXMLTVLoader, IXMLTVParser |
53 |
william |
44 |
{ |
54 |
william |
46 |
//bool IsDisposing { get; } |
55 |
william |
49 |
//IXMLTVSerializer<IXMLTVRuntimeInstance> Serializer { get; } |
56 |
william |
44 |
} |
57 |
william |
49 |
|
58 |
|
|
public interface IXMLTVSerializer<T> |
59 |
|
|
{ |
60 |
|
|
bool Serialize(string file); |
61 |
|
|
bool Serialize(Stream stream); |
62 |
william |
50 |
T DeSerialize(string file, out bool status); |
63 |
|
|
T DeSerialize(Stream stream, out bool status); |
64 |
william |
49 |
} |
65 |
|
|
|
66 |
william |
54 |
public interface IXMLTV<INTERFACE, CLASS> : IXMLTVSerializer<INTERFACE>, IDestroyInstance |
67 |
william |
50 |
where CLASS : class,INTERFACE |
68 |
|
|
{ |
69 |
william |
51 |
IXMLTVSerializer<CLASS> CreateSerializer(); |
70 |
william |
50 |
INTERFACE GetInstance(); |
71 |
|
|
//CLASS GetInternalInstance(); |
72 |
william |
54 |
EventHandler<EventArgs> OnInstanceCreated { get; set; } |
73 |
william |
50 |
} |
74 |
william |
51 |
public interface ISerializer<T> |
75 |
|
|
{ |
76 |
|
|
IXMLTVSerializer<T> Serializer { get; } |
77 |
|
|
} |
78 |
william |
54 |
public interface IDestroyInstance |
79 |
|
|
{ |
80 |
|
|
void DestroyInstance(); |
81 |
|
|
} |
82 |
|
|
public interface IGetCreatedInstanceEvent |
83 |
|
|
{ |
84 |
|
|
EventHandler<EventArgs> GetOnInstanceCreated(); |
85 |
|
|
} |
86 |
|
|
public interface ISetCreatedInstanceEvent |
87 |
|
|
{ |
88 |
|
|
void SetOnInstanceCreated(EventHandler<EventArgs> event_instance); |
89 |
|
|
} |
90 |
william |
56 |
public interface IRuntimeInstanceLoader<T> |
91 |
|
|
{ |
92 |
|
|
T LoadFromInstance(T instance); |
93 |
|
|
} |
94 |
william |
28 |
} |