/[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 91 - (hide annotations) (download)
Sat Mar 9 17:48:02 2013 UTC (7 years, 7 months ago) by william
File size: 5424 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 90 public interface IXMLTVProgram
41 william 86 {
42 william 91 PropertyDictionary MetaData { get; }
43 william 86 }
44 william 72
45 william 73 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 william 72
50 william 81 public interface IXMLTVHandler : IXMLTVHandler<object> { }
51 william 73 public interface IXMLTVHandler<T> { T Handler { get; } }
52    
53 william 72 //public interface IXMLTVBase : IXMLTVBase<object> { }
54 william 81 public interface IXMLTVBase<T> : IGetInstance<T>, IXMLTVHandler { }
55 william 72 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 william 77 IXMLTVSource Source { get; }
63 william 73 List<IXMLTVChannel> Channels { get; }
64     List<IXMLTVProgram> Programs { get; }
65 william 72
66     }
67 william 64 public interface IXMLTVSerializer : IXMLTVSerializer<object> { }
68 william 49 public interface IXMLTVSerializer<T>
69     {
70     bool Serialize(string file);
71     bool Serialize(Stream stream);
72 william 50 T DeSerialize(string file, out bool status);
73     T DeSerialize(Stream stream, out bool status);
74 william 49 }
75 william 64 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 william 50 where CLASS : class,INTERFACE
78 william 64 where INSTANCECREATED_EVENTAGS : EventArgs { }
79 william 72
80     public interface IInstance : IInstance<object> { }
81     public interface IInstance<T> { T Instance { get; set; } }
82 william 64 public interface ICreateSerializer : ICreateSerializer<object> { }
83     public interface ICreateSerializer<CLASS> { IXMLTVSerializer<CLASS> CreateSerializer(); }
84 william 72
85     //public interface IGetInstanceT : IGetInstanceT<object> { }
86     //public interface IGetInstanceT<T> { T GetInstance<T>(); }
87 william 64 public interface IGetInstance : IGetInstance<object> { }
88     public interface IGetInstance<T> { T GetInstance(); }
89 william 72
90 william 64 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 william 90
101    
102 william 91 #region Property Dictionary support
103 william 90 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 william 28 }

  ViewVC Help
Powered by ViewVC 1.1.22