/[xmltv_parser]/trunk/libxmltv/Core/XMLTVChannelCollection.cs
ViewVC logotype

Diff of /trunk/libxmltv/Core/XMLTVChannelCollection.cs

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

--- trunk/libxmltv/Core/XMLTVChannelCollection.cs	2013/03/08 01:22:03	35
+++ trunk/libxmltv/Core/XMLTVChannelCollection.cs	2013/03/08 02:13:59	36
@@ -11,17 +11,19 @@
     internal class XMLTVChannelCollection
     {
         private Dictionary<string, IXMLTVChannel> entries = new Dictionary<string, IXMLTVChannel>();
-        public XMLTVChannelCollection(object xmltv)
+        private XMLTVRuntimeInstance instance;
+        public XMLTVChannelCollection(XMLTVRuntimeInstance xmltv)
         {
             XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("Creating Instance of XMLTVChannelCollection");
-            IXMLTV_PARSER _xmltv;
-            if (!Internals.VerifyInstance<IXMLTV_PARSER>(xmltv, out _xmltv)) { return; }
-            XMLTV_PARSER = _xmltv;
+            //IXMLTV_PARSER _xmltv;
+            //if (!Internals.VerifyInstance<IXMLTV_PARSER>(xmltv, out _xmltv)) { return; }
+            //XMLTV_PARSER = _xmltv;
+            instance = xmltv;
             Create();
         }
 
         #region IXMLTVSource
-        private IXMLTV_PARSER XMLTV_PARSER { get; set; }
+        //private IXMLTV_PARSER XMLTV_PARSER { get; set; }
         public Dictionary<string, IXMLTVChannel> Collection
         {
             get { return entries; }
@@ -30,9 +32,9 @@
 
         private void Create()
         {
-            var doc = XMLTV_PARSER.XMLTV_LOADER.XmlDoc;
+            var doc = instance.XmlDoc;
 
-            foreach (var c in doc.Descendants(XMLTV_CONSTANTS.CHANNEL_ELEMENT))
+            foreach (var c in doc.Descendants(XMLTVConstants.CHANNEL_ELEMENT))
             {
                 Channel channel = new Channel(c);
                 entries.Add(channel.Id, channel);
@@ -58,8 +60,8 @@
             : this()
         {
             // get the channel id
-            Id = e.Attribute(XMLTV_CONSTANTS.Channels.ChannelId).Value;
-            var names = e.Descendants(XMLTV_CONSTANTS.Channels.ChannelDisplayName).ToList();
+            Id = e.Attribute(XMLTVConstants.Channels.ChannelId).Value;
+            var names = e.Descendants(XMLTVConstants.Channels.ChannelDisplayName).ToList();
             Number = Convert.ToInt32(names[1].Value);
             CallSign = names[2].Value;
             Name = names[3].Value;

 

  ViewVC Help
Powered by ViewVC 1.1.22