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 |
using System.Collections; |
10 |
|
11 |
namespace libxmltv.Interfaces |
12 |
{ |
13 |
//public interface IXMLTVLoader |
14 |
//{ |
15 |
// FileInfo XmlFile { get; } |
16 |
// string XmlDoc { get; } |
17 |
//} |
18 |
//public interface IXMLTVParser |
19 |
//{ |
20 |
// IXMLTVSource Source { get; } |
21 |
// Dictionary<string, IXMLTVChannel> Channels { get; } |
22 |
// Dictionary<int, IXMLTVProgram> Programs { get; } |
23 |
//} |
24 |
|
25 |
public interface IXMLTVSource |
26 |
{ |
27 |
string SourceName { get; } |
28 |
string GeneratorName { get; } |
29 |
string GeneratorUrl { get; } |
30 |
string ToString(); |
31 |
} |
32 |
public interface IXMLTVChannel |
33 |
{ |
34 |
string Id { get; } |
35 |
int Number { get; } |
36 |
string CallSign { get; } |
37 |
string Name { get; } |
38 |
string ToString(); |
39 |
} |
40 |
public interface IXMLTVProgram |
41 |
{ |
42 |
PropertyDictionary MetaData { get; } |
43 |
} |
44 |
|
45 |
public interface IXMLTVProgramCollection : IXMLTVDictionaryCollection<string, IXMLTVProgram> { } |
46 |
public interface IXMLTVChannelCollection : IXMLTVDictionaryCollection<string, IXMLTVChannel> { } |
47 |
public interface IXMLTVDictionaryCollection<TKey, TValue> { Dictionary<TKey, TValue> Collection { get; } } |
48 |
public interface IXMLTVListCollection<TValue> { List<TValue> Collection { get; } } |
49 |
|
50 |
public interface IXMLTVHandler : IXMLTVHandler<object> { } |
51 |
public interface IXMLTVHandler<T> { T Handler { get; } } |
52 |
|
53 |
//public interface IXMLTVBase : IXMLTVBase<object> { } |
54 |
public interface IXMLTVBase<T> : IGetInstance<T>, IXMLTVHandler { } |
55 |
public interface IXMLTVRuntimeInstance : IOnInstanceCreated |
56 |
{ |
57 |
bool IsAborting { get; } |
58 |
//FileInfo XmlFile { get; } |
59 |
string XmlFile_Name { get; } |
60 |
string XmlFile_FullName { get; } |
61 |
string XmlDoc { get; } |
62 |
IXMLTVSource Source { get; } |
63 |
List<IXMLTVChannel> Channels { get; } |
64 |
List<IXMLTVProgram> Programs { get; } |
65 |
|
66 |
} |
67 |
public interface IXMLTVSerializer : IXMLTVSerializer<object> { } |
68 |
public interface IXMLTVSerializer<T> |
69 |
{ |
70 |
bool Serialize(string file); |
71 |
bool Serialize(Stream stream); |
72 |
T DeSerialize(string file, out bool status); |
73 |
T DeSerialize(Stream stream, out bool status); |
74 |
} |
75 |
public interface IXMLTV<INTERFACE, CLASS> : IXMLTV<INTERFACE, CLASS, EventArgs> where CLASS : class,INTERFACE { } |
76 |
public interface IXMLTV<INTERFACE, CLASS, INSTANCECREATED_EVENTAGS> : IXMLTVSerializer<INTERFACE>, IDestroyInstance, IOnInstanceCreated, IGetInstance<INTERFACE> |
77 |
where CLASS : class,INTERFACE |
78 |
where INSTANCECREATED_EVENTAGS : EventArgs { } |
79 |
|
80 |
public interface IInstance : IInstance<object> { } |
81 |
public interface IInstance<T> { T Instance { get; set; } } |
82 |
public interface ICreateSerializer : ICreateSerializer<object> { } |
83 |
public interface ICreateSerializer<CLASS> { IXMLTVSerializer<CLASS> CreateSerializer(); } |
84 |
|
85 |
//public interface IGetInstanceT : IGetInstanceT<object> { } |
86 |
//public interface IGetInstanceT<T> { T GetInstance<T>(); } |
87 |
public interface IGetInstance : IGetInstance<object> { } |
88 |
public interface IGetInstance<T> { T GetInstance(); } |
89 |
|
90 |
public interface IOnInstanceCreated : IOnInstanceCreated<EventArgs> { } |
91 |
public interface IOnInstanceCreated<T> where T : EventArgs { EventHandler<T> OnInstanceCreated { get; set; } } |
92 |
public interface ISerializer<T> { IXMLTVSerializer<T> Serializer { get; } } |
93 |
public interface IDestroyInstance { void DestroyInstance(); } |
94 |
public interface IGetCreatedInstanceEvent : IGetCreatedInstanceEvent<EventArgs> { } |
95 |
public interface IGetCreatedInstanceEvent<T> where T : EventArgs { EventHandler<T> GetOnInstanceCreated(); } |
96 |
public interface ISetCreatedInstanceEvent : ISetCreatedInstanceEvent<EventArgs> { } |
97 |
public interface ISetCreatedInstanceEvent<T> where T : EventArgs { void SetOnInstanceCreated(EventHandler<T> event_instance); } |
98 |
public interface IRuntimeInstanceLoader : IRuntimeInstanceLoader<object> { } |
99 |
public interface IRuntimeInstanceLoader<T> { T LoadFromInstance(T instance); } |
100 |
|
101 |
|
102 |
#region Property Dictionary support |
103 |
public interface IPropertyDictionary : IPropertyDictionary<string,object> { } |
104 |
public interface IPropertyDictionary<TKey, TValue> : IPropertyCollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable |
105 |
{ |
106 |
IPropertyCollection<TKey> PropertyKeys { get; } |
107 |
IPropertyCollection<TValue> PropertyValues { get; } |
108 |
TValue this[TKey key] { get; set; } |
109 |
void AddProperty(TKey key, TValue value); |
110 |
bool ContainsProperty(TKey key); |
111 |
bool RemoveProperty(TKey key); |
112 |
bool TryGetPropertyValue(TKey key, out TValue value); |
113 |
} |
114 |
public interface IPropertyCollection<T> : IEnumerable<T>, IEnumerable |
115 |
{ |
116 |
int PropertyCount { get; } |
117 |
bool IsReadOnly { get; } |
118 |
void AddProperty(T item); |
119 |
void ClearProperties(); |
120 |
bool ContainsProperty(T item); |
121 |
void CopyPropertiesTo(T[] array, int arrayIndex); |
122 |
bool RemoveProperty(T item); |
123 |
} |
124 |
#endregion |
125 |
} |