1 |
using System; |
2 |
using System.Collections.Generic; |
3 |
using System.Linq; |
4 |
using System.Text; |
5 |
using System.IO; |
6 |
using System.Xml.Linq; |
7 |
using libxmltv.Core; |
8 |
using System.ComponentModel; |
9 |
|
10 |
namespace libxmltv.Interfaces |
11 |
{ |
12 |
//public interface IXMLTVLoader |
13 |
//{ |
14 |
// FileInfo XmlFile { get; } |
15 |
// string XmlDoc { get; } |
16 |
//} |
17 |
//public interface IXMLTVParser |
18 |
//{ |
19 |
// IXMLTVSource Source { get; } |
20 |
// Dictionary<string, IXMLTVChannel> Channels { get; } |
21 |
// Dictionary<int, IXMLTVProgram> Programs { get; } |
22 |
//} |
23 |
|
24 |
public interface IXMLTVSource |
25 |
{ |
26 |
string SourceName { get; } |
27 |
string GeneratorName { get; } |
28 |
string GeneratorUrl { get; } |
29 |
string ToString(); |
30 |
} |
31 |
public interface IXMLTVChannel |
32 |
{ |
33 |
string Id { get; } |
34 |
int Number { get; } |
35 |
string CallSign { get; } |
36 |
string Name { get; } |
37 |
string ToString(); |
38 |
} |
39 |
|
40 |
public interface IPropertyDictionary : IPropertyDictionary<string, object> { } |
41 |
public interface IPropertyDictionary<TKey,TValue> |
42 |
{ |
43 |
Dictionary<TKey, TValue> Properties { get; } |
44 |
TValue GetProperty(TKey propertyname); |
45 |
void SetProperty(TKey propertyname, TValue propertyvalue); |
46 |
bool ContainsProperty(string propertyname); |
47 |
|
48 |
void AddProperty(TKey propertyname); |
49 |
void AddProperty(TKey propertyname, TValue propertyvalue); |
50 |
void RemoveProperty(string propertyname); |
51 |
} |
52 |
public interface IXMLTVProgram : IPropertyDictionary |
53 |
{ |
54 |
//int Id { get; } |
55 |
//DateTime Start { get; } |
56 |
//DateTime Stop { get; } |
57 |
//IXMLTVChannel Channel { get; } |
58 |
//string Title { get; } |
59 |
//string SubTitle { get; } |
60 |
//string Description { get; } |
61 |
//string ToString(); |
62 |
|
63 |
} |
64 |
|
65 |
public interface IXMLTVProgramCollection : IXMLTVDictionaryCollection<string, IXMLTVProgram> { } |
66 |
public interface IXMLTVChannelCollection : IXMLTVDictionaryCollection<string, IXMLTVChannel> { } |
67 |
public interface IXMLTVDictionaryCollection<TKey, TValue> { Dictionary<TKey, TValue> Collection { get; } } |
68 |
public interface IXMLTVListCollection<TValue> { List<TValue> Collection { get; } } |
69 |
|
70 |
public interface IXMLTVHandler : IXMLTVHandler<object> { } |
71 |
public interface IXMLTVHandler<T> { T Handler { get; } } |
72 |
|
73 |
//public interface IXMLTVBase : IXMLTVBase<object> { } |
74 |
public interface IXMLTVBase<T> : IGetInstance<T>, IXMLTVHandler { } |
75 |
public interface IXMLTVRuntimeInstance : IOnInstanceCreated |
76 |
{ |
77 |
bool IsAborting { get; } |
78 |
//FileInfo XmlFile { get; } |
79 |
string XmlFile_Name { get; } |
80 |
string XmlFile_FullName { get; } |
81 |
string XmlDoc { get; } |
82 |
IXMLTVSource Source { get; } |
83 |
List<IXMLTVChannel> Channels { get; } |
84 |
List<IXMLTVProgram> Programs { get; } |
85 |
|
86 |
} |
87 |
public interface IXMLTVSerializer : IXMLTVSerializer<object> { } |
88 |
public interface IXMLTVSerializer<T> |
89 |
{ |
90 |
bool Serialize(string file); |
91 |
bool Serialize(Stream stream); |
92 |
T DeSerialize(string file, out bool status); |
93 |
T DeSerialize(Stream stream, out bool status); |
94 |
} |
95 |
public interface IXMLTV<INTERFACE, CLASS> : IXMLTV<INTERFACE, CLASS, EventArgs> where CLASS : class,INTERFACE { } |
96 |
public interface IXMLTV<INTERFACE, CLASS, INSTANCECREATED_EVENTAGS> : IXMLTVSerializer<INTERFACE>, IDestroyInstance, IOnInstanceCreated, IGetInstance<INTERFACE> |
97 |
where CLASS : class,INTERFACE |
98 |
where INSTANCECREATED_EVENTAGS : EventArgs { } |
99 |
|
100 |
public interface IInstance : IInstance<object> { } |
101 |
public interface IInstance<T> { T Instance { get; set; } } |
102 |
public interface ICreateSerializer : ICreateSerializer<object> { } |
103 |
public interface ICreateSerializer<CLASS> { IXMLTVSerializer<CLASS> CreateSerializer(); } |
104 |
|
105 |
//public interface IGetInstanceT : IGetInstanceT<object> { } |
106 |
//public interface IGetInstanceT<T> { T GetInstance<T>(); } |
107 |
public interface IGetInstance : IGetInstance<object> { } |
108 |
public interface IGetInstance<T> { T GetInstance(); } |
109 |
|
110 |
public interface IOnInstanceCreated : IOnInstanceCreated<EventArgs> { } |
111 |
public interface IOnInstanceCreated<T> where T : EventArgs { EventHandler<T> OnInstanceCreated { get; set; } } |
112 |
public interface ISerializer<T> { IXMLTVSerializer<T> Serializer { get; } } |
113 |
public interface IDestroyInstance { void DestroyInstance(); } |
114 |
public interface IGetCreatedInstanceEvent : IGetCreatedInstanceEvent<EventArgs> { } |
115 |
public interface IGetCreatedInstanceEvent<T> where T : EventArgs { EventHandler<T> GetOnInstanceCreated(); } |
116 |
public interface ISetCreatedInstanceEvent : ISetCreatedInstanceEvent<EventArgs> { } |
117 |
public interface ISetCreatedInstanceEvent<T> where T : EventArgs { void SetOnInstanceCreated(EventHandler<T> event_instance); } |
118 |
public interface IRuntimeInstanceLoader : IRuntimeInstanceLoader<object> { } |
119 |
public interface IRuntimeInstanceLoader<T> { T LoadFromInstance(T instance); } |
120 |
} |