/[xmltv_parser]/trunk/libxmltv/Interfaces/Interfaces.cs
ViewVC logotype

Contents of /trunk/libxmltv/Interfaces/Interfaces.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 90 - (show annotations) (download)
Sat Mar 9 17:42:34 2013 UTC (7 years, 8 months ago) by william
File size: 6252 byte(s)

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
41 //public interface IPropertyDictionary : IPropertyDictionary<string, object> { }
42 //public interface IPropertyDictionary<TKey,TValue>
43 //{
44 // Dictionary<TKey, TValue> Properties { get; }
45 // TValue GetProperty(TKey propertyname);
46 // void SetProperty(TKey propertyname, TValue propertyvalue);
47 // bool ContainsProperty(string propertyname);
48
49 // void AddProperty(TKey propertyname);
50 // void AddProperty(TKey propertyname, TValue propertyvalue);
51 // void RemoveProperty(string propertyname);
52 //}
53 public interface IXMLTVProgram
54 {
55 //int Id { get; }
56 //DateTime Start { get; }
57 //DateTime Stop { get; }
58 //IXMLTVChannel Channel { get; }
59 //string Title { get; }
60 //string SubTitle { get; }
61 //string Description { get; }
62 //string ToString();
63 PropertyDictionary Properties { get; }
64 }
65
66 public interface IXMLTVProgramCollection : IXMLTVDictionaryCollection<string, IXMLTVProgram> { }
67 public interface IXMLTVChannelCollection : IXMLTVDictionaryCollection<string, IXMLTVChannel> { }
68 public interface IXMLTVDictionaryCollection<TKey, TValue> { Dictionary<TKey, TValue> Collection { get; } }
69 public interface IXMLTVListCollection<TValue> { List<TValue> Collection { get; } }
70
71 public interface IXMLTVHandler : IXMLTVHandler<object> { }
72 public interface IXMLTVHandler<T> { T Handler { get; } }
73
74 //public interface IXMLTVBase : IXMLTVBase<object> { }
75 public interface IXMLTVBase<T> : IGetInstance<T>, IXMLTVHandler { }
76 public interface IXMLTVRuntimeInstance : IOnInstanceCreated
77 {
78 bool IsAborting { get; }
79 //FileInfo XmlFile { get; }
80 string XmlFile_Name { get; }
81 string XmlFile_FullName { get; }
82 string XmlDoc { get; }
83 IXMLTVSource Source { get; }
84 List<IXMLTVChannel> Channels { get; }
85 List<IXMLTVProgram> Programs { get; }
86
87 }
88 public interface IXMLTVSerializer : IXMLTVSerializer<object> { }
89 public interface IXMLTVSerializer<T>
90 {
91 bool Serialize(string file);
92 bool Serialize(Stream stream);
93 T DeSerialize(string file, out bool status);
94 T DeSerialize(Stream stream, out bool status);
95 }
96 public interface IXMLTV<INTERFACE, CLASS> : IXMLTV<INTERFACE, CLASS, EventArgs> where CLASS : class,INTERFACE { }
97 public interface IXMLTV<INTERFACE, CLASS, INSTANCECREATED_EVENTAGS> : IXMLTVSerializer<INTERFACE>, IDestroyInstance, IOnInstanceCreated, IGetInstance<INTERFACE>
98 where CLASS : class,INTERFACE
99 where INSTANCECREATED_EVENTAGS : EventArgs { }
100
101 public interface IInstance : IInstance<object> { }
102 public interface IInstance<T> { T Instance { get; set; } }
103 public interface ICreateSerializer : ICreateSerializer<object> { }
104 public interface ICreateSerializer<CLASS> { IXMLTVSerializer<CLASS> CreateSerializer(); }
105
106 //public interface IGetInstanceT : IGetInstanceT<object> { }
107 //public interface IGetInstanceT<T> { T GetInstance<T>(); }
108 public interface IGetInstance : IGetInstance<object> { }
109 public interface IGetInstance<T> { T GetInstance(); }
110
111 public interface IOnInstanceCreated : IOnInstanceCreated<EventArgs> { }
112 public interface IOnInstanceCreated<T> where T : EventArgs { EventHandler<T> OnInstanceCreated { get; set; } }
113 public interface ISerializer<T> { IXMLTVSerializer<T> Serializer { get; } }
114 public interface IDestroyInstance { void DestroyInstance(); }
115 public interface IGetCreatedInstanceEvent : IGetCreatedInstanceEvent<EventArgs> { }
116 public interface IGetCreatedInstanceEvent<T> where T : EventArgs { EventHandler<T> GetOnInstanceCreated(); }
117 public interface ISetCreatedInstanceEvent : ISetCreatedInstanceEvent<EventArgs> { }
118 public interface ISetCreatedInstanceEvent<T> where T : EventArgs { void SetOnInstanceCreated(EventHandler<T> event_instance); }
119 public interface IRuntimeInstanceLoader : IRuntimeInstanceLoader<object> { }
120 public interface IRuntimeInstanceLoader<T> { T LoadFromInstance(T instance); }
121
122
123 #region prop
124 public interface IPropertyDictionary : IPropertyDictionary<string,object> { }
125 public interface IPropertyDictionary<TKey, TValue> : IPropertyCollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable
126 {
127 IPropertyCollection<TKey> PropertyKeys { get; }
128 IPropertyCollection<TValue> PropertyValues { get; }
129 TValue this[TKey key] { get; set; }
130 void AddProperty(TKey key, TValue value);
131 bool ContainsProperty(TKey key);
132 bool RemoveProperty(TKey key);
133 bool TryGetPropertyValue(TKey key, out TValue value);
134 }
135 public interface IPropertyCollection<T> : IEnumerable<T>, IEnumerable
136 {
137 int PropertyCount { get; }
138 bool IsReadOnly { get; }
139 void AddProperty(T item);
140 void ClearProperties();
141 bool ContainsProperty(T item);
142 void CopyPropertiesTo(T[] array, int arrayIndex);
143 bool RemoveProperty(T item);
144 }
145 #endregion
146 }

  ViewVC Help
Powered by ViewVC 1.1.22