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

Annotation of /trunk/libxmltv/Interfaces/Interfaces.cs

Parent Directory Parent Directory | Revision Log Revision Log


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

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 90 using System.Collections;
10 william 10
11     namespace libxmltv.Interfaces
12     {
13 william 72 //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 william 25
25     public interface IXMLTVSource
26     {
27     string SourceName { get; }
28     string GeneratorName { get; }
29     string GeneratorUrl { get; }
30     string ToString();
31     }
32 william 26 public interface IXMLTVChannel
33     {
34 william 28 string Id { get; }
35     int Number { get; }
36     string CallSign { get; }
37     string Name { get; }
38     string ToString();
39 william 64 }
40 william 86
41 william 90 //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 william 87
49 william 90 // void AddProperty(TKey propertyname);
50     // void AddProperty(TKey propertyname, TValue propertyvalue);
51     // void RemoveProperty(string propertyname);
52     //}
53     public interface IXMLTVProgram
54 william 86 {
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 william 90 PropertyDictionary Properties { get; }
64 william 86 }
65 william 72
66 william 73 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 william 72
71 william 81 public interface IXMLTVHandler : IXMLTVHandler<object> { }
72 william 73 public interface IXMLTVHandler<T> { T Handler { get; } }
73    
74 william 72 //public interface IXMLTVBase : IXMLTVBase<object> { }
75 william 81 public interface IXMLTVBase<T> : IGetInstance<T>, IXMLTVHandler { }
76 william 72 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 william 77 IXMLTVSource Source { get; }
84 william 73 List<IXMLTVChannel> Channels { get; }
85     List<IXMLTVProgram> Programs { get; }
86 william 72
87     }
88 william 64 public interface IXMLTVSerializer : IXMLTVSerializer<object> { }
89 william 49 public interface IXMLTVSerializer<T>
90     {
91     bool Serialize(string file);
92     bool Serialize(Stream stream);
93 william 50 T DeSerialize(string file, out bool status);
94     T DeSerialize(Stream stream, out bool status);
95 william 49 }
96 william 64 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 william 50 where CLASS : class,INTERFACE
99 william 64 where INSTANCECREATED_EVENTAGS : EventArgs { }
100 william 72
101     public interface IInstance : IInstance<object> { }
102     public interface IInstance<T> { T Instance { get; set; } }
103 william 64 public interface ICreateSerializer : ICreateSerializer<object> { }
104     public interface ICreateSerializer<CLASS> { IXMLTVSerializer<CLASS> CreateSerializer(); }
105 william 72
106     //public interface IGetInstanceT : IGetInstanceT<object> { }
107     //public interface IGetInstanceT<T> { T GetInstance<T>(); }
108 william 64 public interface IGetInstance : IGetInstance<object> { }
109     public interface IGetInstance<T> { T GetInstance(); }
110 william 72
111 william 64 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 william 90
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 william 28 }

  ViewVC Help
Powered by ViewVC 1.1.22