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

Diff of /trunk/libxmltv/Interfaces/Interfaces.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 107 by william, Sun Mar 10 12:58:40 2013 UTC revision 256 by william, Sat May 18 02:45:35 2013 UTC
# Line 23  namespace libxmltv.Interfaces Line 23  namespace libxmltv.Interfaces
23      //    Dictionary<int, IXMLTVProgram> Programs { get; }      //    Dictionary<int, IXMLTVProgram> Programs { get; }
24      //}      //}
25    
26      public interface IXMLTVSource      public interface IXMLTVSource : IDataSourceBindable
27      {      {
28          string SourceName { get; }          string SourceName { get; }
29          string GeneratorName { get; }          string GeneratorName { get; }
30          string GeneratorUrl { get; }          string GeneratorUrl { get; }
31          string ToString();          string ToString();
32      }      }
33    
34        public interface IRawDataSource : IRawDataSource<object> { }
35        public interface IRawDataSource<T> {
36             [Browsable(false)]
37            T RawDataSource { get; } }
38        public interface IProgramDefinitionList : IList<IProgramDefinition>, IDataSourceSortable, IDataSourceFilterable { } //, IRawDataSource<IProgramDefinitionList> { }
39        public interface IChannelDefintionList : IList<IChannelDefintion>, IDataSourceSortable, IDataSourceFilterable { }//, IRawDataSource<IChannelDefintionList> { }
40    
41    
42        public interface IChannelDefintion : IEquatable<IChannelDefintion>, IRawDataSource<IXMLTVChannel>
43        {
44            string ChannelId { get; }
45            string ChannelName { get; }
46            string ToString();
47        }
48        public interface IProgramDefinition : IEquatable<IProgramDefinition>, IRawDataSource<IXMLTVProgram>
49        {
50            //string ChannelId { get;  }
51            int ChannelNumber { get; } // column index: 0
52            string ChannelName { get; }// column index: 1
53            string Start { get; }// column index: 2
54            string Stop { get; }// column index: 3
55            string Title { get; }// column index: 4
56            string SubTitle { get; }// column index: 5
57            string Description { get; }// column index: 6
58            string Rating { get; }// column index: 7
59            string ToString();
60        }
61      public interface IXMLTVChannel      public interface IXMLTVChannel
62      {      {
63          string Id { get; }          string Id { get; }
64          //int Number { get; }          //int Number { get; }
65          //string CallSign { get; }          //string CallSign { get; }
66          //string Name { get; }              //string Name { get; }    
67          PropertyList MetaData { get; }          IPropertyList MetaData { get; }
68          string ToString();          string ToString();
69      }      }
70      public interface IXMLTVProgram      public interface IXMLTVProgram
71      {      {
72          PropertyDictionary MetaData { get; }          IPropertyDictionary MetaData { get; }
73            List<IExtraMetaData> GetExtraMetaData();
74      }      }
75    
76      public interface IExtraMetaData : IExtraMetaData<XElement> { }      public interface IExtraMetaData : IExtraMetaData<string, string> { }
77      public interface IExtraMetaData<TValue> : IExtraMetaData<string, TValue> { }      public interface IExtraMetaData<TKey, TValue> : IPropertyValuePair<TKey, TValue>
78      public interface IExtraMetaData<TKey, TValue> : IPropertyValuePair<TKey, TValue> { }      {
79      public interface IXMLTVProgramCollection : IXMLTVDictionaryCollection<string, IXMLTVProgram> { }          XElement AsXElement();
80      public interface IXMLTVChannelCollection : IXMLTVDictionaryCollection<string, IXMLTVChannel> { }      }
     public interface IXMLTVDictionaryCollection<TKey, TValue> { Dictionary<TKey, TValue> Collection { get; } }  
     public interface IXMLTVListCollection<TValue> { List<TValue> Collection { get; } }  
81    
82      public interface IXMLTVHandler : IXMLTVHandler<object> { }      //public interface IDataConverter { object ConvertObjectData(object source); }
83      public interface IXMLTVHandler<T> { T Handler { get; } }      //public interface IDataConverter<T>
84        //{
85        //    T ConvertData(object source);
86        //}
87        public interface IDataSourceBindable //: IDataConverter
88        {
89            object CreateBindableDataSource(out Type type);
90        }
91    
92        public interface IDataSourceFilterable
93        {
94            void Filter(ref object source, params string[] args);
95        }
96        public interface IDataSourceSortable
97        {
98            void Sort(ref object source, bool descending, params string[] args);
99        }
100    
101        internal interface IXMLTVProgramCollection : IXMLTVDictionaryCollection<string, IXMLTVProgram> { }
102        internal interface IXMLTVChannelCollection : IXMLTVDictionaryCollection<string, IXMLTVChannel> { }
103        internal interface IXMLTVDictionaryCollection<TKey, TValue> { Dictionary<TKey, TValue> Collection { get; } }
104        internal interface IXMLTVListCollection<TValue> { List<TValue> Collection { get; } }
105    
106        internal interface IXMLTVHandler : IXMLTVHandler<object> { }
107        internal interface IXMLTVHandler<T> { T Handler { get; } }
108    
109      //public interface IXMLTVBase : IXMLTVBase<object> { }      //public interface IXMLTVBase : IXMLTVBase<object> { }
110      public interface IXMLTVBase<T> : IGetInstance<T>, IXMLTVHandler { }      internal interface IXMLTVBase<T> : IGetInstance<T>, IXMLTVHandler { }
111      public interface IXMLTVRuntimeInstance : IOnInstanceCreated      internal interface IXMLTVRuntimeInstance : IOnInstanceCreated
112      {      {
113          bool IsAborting { get; }          bool IsAborting { get; }
114          //FileInfo XmlFile { get; }          //FileInfo XmlFile { get; }
# Line 65  namespace libxmltv.Interfaces Line 116  namespace libxmltv.Interfaces
116          string XmlFile_FullName { get; }          string XmlFile_FullName { get; }
117          string XmlDoc { get; }          string XmlDoc { get; }
118          IXMLTVSource Source { get; }          IXMLTVSource Source { get; }
119          List<IXMLTVChannel> Channels { get; }          ChannelList Channels { get; }
120          List<IXMLTVProgram> Programs { get; }          ProgramList Programs { get; }
121          List<IExtraMetaData> ExtraEntries { get; }         ExtraList ExtraEntries { get; }
122      }      }
123      public interface IXMLTVSerializer : IXMLTVSerializer<object> { }      internal interface IXMLTVSerializer : IXMLTVSerializer<object> { }
124      public interface IXMLTVSerializer<T>      internal interface IXMLTVSerializer<T>
125      {      {
126          bool Serialize(string file);          bool Serialize(string file);
127          bool Serialize(Stream stream);          bool Serialize(Stream stream);
128          T DeSerialize(string file, out bool status);          T DeSerialize(string file, out bool status);
129          T DeSerialize(Stream stream, out bool status);          T DeSerialize(Stream stream, out bool status);
130      }      }
131      public interface IXMLTV<INTERFACE, CLASS> : IXMLTV<INTERFACE, CLASS, EventArgs> where CLASS : class,INTERFACE { }      internal interface IXMLTV<INTERFACE, CLASS> : IXMLTV<INTERFACE, CLASS, EventArgs> where CLASS : class,INTERFACE { }
132      public interface IXMLTV<INTERFACE, CLASS, INSTANCECREATED_EVENTAGS> : IXMLTVSerializer<INTERFACE>, IDestroyInstance, IOnInstanceCreated, IGetInstance<INTERFACE>      internal interface IXMLTV<INTERFACE, CLASS, INSTANCECREATED_EVENTAGS> : IXMLTVSerializer<INTERFACE>, IDestroyInstance, IOnInstanceCreated, IGetInstance<INTERFACE>, ISetInstance<INTERFACE>
133          where CLASS : class,INTERFACE          where CLASS : class,INTERFACE
134          where INSTANCECREATED_EVENTAGS : EventArgs { }          where INSTANCECREATED_EVENTAGS : EventArgs { }
135    
136      public interface IInstance : IInstance<object> { }      internal interface IInstance : IInstance<object> { }
137      public interface IInstance<T> { T Instance { get; set; } }      internal interface IInstance<T> { T Instance { get; set; } }
138      public interface ICreateSerializer : ICreateSerializer<object> { }      internal interface ICreateSerializer : ICreateSerializer<object> { }
139      public interface ICreateSerializer<CLASS> { IXMLTVSerializer<CLASS> CreateSerializer(); }      internal interface ICreateSerializer<CLASS> { IXMLTVSerializer<CLASS> CreateSerializer(); }
140    
141      //public interface IGetInstanceT : IGetInstanceT<object> { }      //public interface IGetInstanceT : IGetInstanceT<object> { }
142      //public interface IGetInstanceT<T> { T GetInstance<T>();  }      //public interface IGetInstanceT<T> { T GetInstance<T>();  }
143      public interface IGetInstance : IGetInstance<object> { }      internal interface IGetInstance : IGetInstance<object> { }
144      public interface IGetInstance<T> { T GetInstance();    }      internal interface IGetInstance<T> { T GetInstance();    }
145    
146      public interface IOnInstanceCreated : IOnInstanceCreated<EventArgs> { }      internal interface ISetInstance : ISetInstance<object> { }
147      public interface IOnInstanceCreated<T> where T : EventArgs { EventHandler<T> OnInstanceCreated { get; set; } }      internal interface ISetInstance<T> { void SetInstance(T instance);    }
148      public interface ISerializer<T> { IXMLTVSerializer<T> Serializer { get; } }  
149      public interface IDestroyInstance { void DestroyInstance();    }      internal interface IOnInstanceCreated : IOnInstanceCreated<EventArgs> { }
150      public interface IGetCreatedInstanceEvent : IGetCreatedInstanceEvent<EventArgs> { }      internal interface IOnInstanceCreated<T> where T : EventArgs { EventHandler<T> OnInstanceCreated { get; set; } }
151      public interface IGetCreatedInstanceEvent<T> where T : EventArgs { EventHandler<T> GetOnInstanceCreated();    }      internal interface ISerializer<T> { IXMLTVSerializer<T> Serializer { get; } }
152      public interface ISetCreatedInstanceEvent : ISetCreatedInstanceEvent<EventArgs> { }      internal interface IDestroyInstance { void DestroyInstance();    }
153      public interface ISetCreatedInstanceEvent<T> where T : EventArgs { void SetOnInstanceCreated(EventHandler<T> event_instance);    }      internal interface IGetCreatedInstanceEvent : IGetCreatedInstanceEvent<EventArgs> { }
154      public interface IRuntimeInstanceLoader : IRuntimeInstanceLoader<object> { }      internal interface IGetCreatedInstanceEvent<T> where T : EventArgs { EventHandler<T> GetOnInstanceCreated();    }
155      public interface IRuntimeInstanceLoader<T> { T LoadFromInstance(T instance);    }      internal interface ISetCreatedInstanceEvent : ISetCreatedInstanceEvent<EventArgs> { }
156        internal interface ISetCreatedInstanceEvent<T> where T : EventArgs { void SetOnInstanceCreated(EventHandler<T> event_instance);    }
157        internal interface IRuntimeInstanceLoader : IRuntimeInstanceLoader<object> { }
158        internal interface IRuntimeInstanceLoader<T> { T LoadFromInstance(T instance);    }
159    
160    
161  #region Property Dictionary support  #region Property Dictionary support
162      public interface IPropertyDictionary : IPropertyDictionary<string,object> { }      public interface IPropertyDictionary : IPropertyDictionary<string, object> { }
163      public interface IPropertyDictionary<TKey, TValue> : IPropertyCollection<IPropertyValuePair<TKey, TValue>>, IEnumerable<IPropertyValuePair<TKey, TValue>>, IEnumerable      public interface IPropertyDictionary<TKey, TValue> : IPropertyCollection<IPropertyValuePair<TKey, TValue>>, IEnumerable<IPropertyValuePair<TKey, TValue>>, IEnumerable
164      {      {
165          IPropertyCollection<TKey> PropertyKeys { get; }          IPropertyCollection<TKey> PropertyKeys { get; }
# Line 147  namespace libxmltv.Interfaces Line 201  namespace libxmltv.Interfaces
201    
202      #region PropertyValuePair support      #region PropertyValuePair support
203    
204      public interface IPropertyValuePair : IPropertyValuePair<string,object>    {      public interface IPropertyValuePair : IPropertyValuePair<string, object>    {    }
     }  
205      public interface IPropertyValuePair<TKey, TValue>      public interface IPropertyValuePair<TKey, TValue>
206      {      {
207          TKey Name { get; }          TKey Name { get; }
208          TValue Value { get; }          TValue Value { get; }
209          string ToString();          string ToString();
210      }      }
211        [Serializable]
212      internal class PropertyValuePair : PropertyValuePair<string, object>, IPropertyValuePair      internal class PropertyValuePair : PropertyValuePair<string, object>, IPropertyValuePair
213      {      {
214          public PropertyValuePair() :base() { }          public PropertyValuePair() :base() { }
215          public PropertyValuePair(string name, object value) : base(name,value) { }          public PropertyValuePair(string name, object value) : base(name,value) { }
216      }      }
217        [Serializable]
218      internal class PropertyValuePair<TKey, TValue> : IPropertyValuePair<TKey,TValue>      internal class PropertyValuePair<TKey, TValue> : IPropertyValuePair<TKey,TValue>
219      {      {
220          #region KeyValuePair support          #region KeyValuePair support

Legend:
Removed from v.107  
changed lines
  Added in v.256

  ViewVC Help
Powered by ViewVC 1.1.22