--- trunk/libxmltv/Interfaces/Interfaces.cs 2013/03/10 14:28:57 110 +++ trunk/libxmltv/Interfaces/Interfaces.cs 2013/05/18 02:45:35 256 @@ -23,43 +23,92 @@ // Dictionary Programs { get; } //} - public interface IXMLTVSource + public interface IXMLTVSource : IDataSourceBindable { string SourceName { get; } string GeneratorName { get; } string GeneratorUrl { get; } string ToString(); } + + public interface IRawDataSource : IRawDataSource { } + public interface IRawDataSource { + [Browsable(false)] + T RawDataSource { get; } } + public interface IProgramDefinitionList : IList, IDataSourceSortable, IDataSourceFilterable { } //, IRawDataSource { } + public interface IChannelDefintionList : IList, IDataSourceSortable, IDataSourceFilterable { }//, IRawDataSource { } + + + public interface IChannelDefintion : IEquatable, IRawDataSource + { + string ChannelId { get; } + string ChannelName { get; } + string ToString(); + } + public interface IProgramDefinition : IEquatable, IRawDataSource + { + //string ChannelId { get; } + int ChannelNumber { get; } // column index: 0 + string ChannelName { get; }// column index: 1 + string Start { get; }// column index: 2 + string Stop { get; }// column index: 3 + string Title { get; }// column index: 4 + string SubTitle { get; }// column index: 5 + string Description { get; }// column index: 6 + string Rating { get; }// column index: 7 + string ToString(); + } public interface IXMLTVChannel { string Id { get; } //int Number { get; } //string CallSign { get; } //string Name { get; } - PropertyList MetaData { get; } + IPropertyList MetaData { get; } string ToString(); } - public interface IXMLTVProgram + public interface IXMLTVProgram { - PropertyDictionary MetaData { get; } + IPropertyDictionary MetaData { get; } + List GetExtraMetaData(); } - + public interface IExtraMetaData : IExtraMetaData { } public interface IExtraMetaData : IPropertyValuePair { XElement AsXElement(); } - public interface IXMLTVProgramCollection : IXMLTVDictionaryCollection { } - public interface IXMLTVChannelCollection : IXMLTVDictionaryCollection { } - public interface IXMLTVDictionaryCollection { Dictionary Collection { get; } } - public interface IXMLTVListCollection { List Collection { get; } } - public interface IXMLTVHandler : IXMLTVHandler { } - public interface IXMLTVHandler { T Handler { get; } } + //public interface IDataConverter { object ConvertObjectData(object source); } + //public interface IDataConverter + //{ + // T ConvertData(object source); + //} + public interface IDataSourceBindable //: IDataConverter + { + object CreateBindableDataSource(out Type type); + } + + public interface IDataSourceFilterable + { + void Filter(ref object source, params string[] args); + } + public interface IDataSourceSortable + { + void Sort(ref object source, bool descending, params string[] args); + } + + internal interface IXMLTVProgramCollection : IXMLTVDictionaryCollection { } + internal interface IXMLTVChannelCollection : IXMLTVDictionaryCollection { } + internal interface IXMLTVDictionaryCollection { Dictionary Collection { get; } } + internal interface IXMLTVListCollection { List Collection { get; } } + + internal interface IXMLTVHandler : IXMLTVHandler { } + internal interface IXMLTVHandler { T Handler { get; } } //public interface IXMLTVBase : IXMLTVBase { } - public interface IXMLTVBase : IGetInstance, IXMLTVHandler { } - public interface IXMLTVRuntimeInstance : IOnInstanceCreated + internal interface IXMLTVBase : IGetInstance, IXMLTVHandler { } + internal interface IXMLTVRuntimeInstance : IOnInstanceCreated { bool IsAborting { get; } //FileInfo XmlFile { get; } @@ -67,47 +116,50 @@ string XmlFile_FullName { get; } string XmlDoc { get; } IXMLTVSource Source { get; } - List Channels { get; } - List Programs { get; } - List ExtraEntries { get; } + ChannelList Channels { get; } + ProgramList Programs { get; } + ExtraList ExtraEntries { get; } } - public interface IXMLTVSerializer : IXMLTVSerializer { } - public interface IXMLTVSerializer + internal interface IXMLTVSerializer : IXMLTVSerializer { } + internal interface IXMLTVSerializer { bool Serialize(string file); bool Serialize(Stream stream); T DeSerialize(string file, out bool status); T DeSerialize(Stream stream, out bool status); } - public interface IXMLTV : IXMLTV where CLASS : class,INTERFACE { } - public interface IXMLTV : IXMLTVSerializer, IDestroyInstance, IOnInstanceCreated, IGetInstance + internal interface IXMLTV : IXMLTV where CLASS : class,INTERFACE { } + internal interface IXMLTV : IXMLTVSerializer, IDestroyInstance, IOnInstanceCreated, IGetInstance, ISetInstance where CLASS : class,INTERFACE where INSTANCECREATED_EVENTAGS : EventArgs { } - public interface IInstance : IInstance { } - public interface IInstance { T Instance { get; set; } } - public interface ICreateSerializer : ICreateSerializer { } - public interface ICreateSerializer { IXMLTVSerializer CreateSerializer(); } + internal interface IInstance : IInstance { } + internal interface IInstance { T Instance { get; set; } } + internal interface ICreateSerializer : ICreateSerializer { } + internal interface ICreateSerializer { IXMLTVSerializer CreateSerializer(); } //public interface IGetInstanceT : IGetInstanceT { } //public interface IGetInstanceT { T GetInstance(); } - public interface IGetInstance : IGetInstance { } - public interface IGetInstance { T GetInstance(); } + internal interface IGetInstance : IGetInstance { } + internal interface IGetInstance { T GetInstance(); } - public interface IOnInstanceCreated : IOnInstanceCreated { } - public interface IOnInstanceCreated where T : EventArgs { EventHandler OnInstanceCreated { get; set; } } - public interface ISerializer { IXMLTVSerializer Serializer { get; } } - public interface IDestroyInstance { void DestroyInstance(); } - public interface IGetCreatedInstanceEvent : IGetCreatedInstanceEvent { } - public interface IGetCreatedInstanceEvent where T : EventArgs { EventHandler GetOnInstanceCreated(); } - public interface ISetCreatedInstanceEvent : ISetCreatedInstanceEvent { } - public interface ISetCreatedInstanceEvent where T : EventArgs { void SetOnInstanceCreated(EventHandler event_instance); } - public interface IRuntimeInstanceLoader : IRuntimeInstanceLoader { } - public interface IRuntimeInstanceLoader { T LoadFromInstance(T instance); } + internal interface ISetInstance : ISetInstance { } + internal interface ISetInstance { void SetInstance(T instance); } + + internal interface IOnInstanceCreated : IOnInstanceCreated { } + internal interface IOnInstanceCreated where T : EventArgs { EventHandler OnInstanceCreated { get; set; } } + internal interface ISerializer { IXMLTVSerializer Serializer { get; } } + internal interface IDestroyInstance { void DestroyInstance(); } + internal interface IGetCreatedInstanceEvent : IGetCreatedInstanceEvent { } + internal interface IGetCreatedInstanceEvent where T : EventArgs { EventHandler GetOnInstanceCreated(); } + internal interface ISetCreatedInstanceEvent : ISetCreatedInstanceEvent { } + internal interface ISetCreatedInstanceEvent where T : EventArgs { void SetOnInstanceCreated(EventHandler event_instance); } + internal interface IRuntimeInstanceLoader : IRuntimeInstanceLoader { } + internal interface IRuntimeInstanceLoader { T LoadFromInstance(T instance); } #region Property Dictionary support - public interface IPropertyDictionary : IPropertyDictionary { } + public interface IPropertyDictionary : IPropertyDictionary { } public interface IPropertyDictionary : IPropertyCollection>, IEnumerable>, IEnumerable { IPropertyCollection PropertyKeys { get; } @@ -149,8 +201,7 @@ #region PropertyValuePair support - public interface IPropertyValuePair : IPropertyValuePair { - } + public interface IPropertyValuePair : IPropertyValuePair { } public interface IPropertyValuePair { TKey Name { get; }