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

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

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

revision 31 by william, Thu Mar 7 13:46:39 2013 UTC revision 36 by william, Fri Mar 8 02:13:59 2013 UTC
# Line 11  namespace libxmltv.Core Line 11  namespace libxmltv.Core
11      internal class XMLTVSource : IXMLTVSource      internal class XMLTVSource : IXMLTVSource
12      {      {
13          private Dictionary<string, string> entries = new Dictionary<string, string>();          private Dictionary<string, string> entries = new Dictionary<string, string>();
14          public XMLTVSource(object xmltv)          private XMLTVRuntimeInstance instance;
15            public XMLTVSource(XMLTVRuntimeInstance xmltv)
16          {          {
17              XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("Creating Instance of XMLTVSource");              XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("Creating Instance of XMLTVSource");
18              IXMLTV_PARSER _xmltv;              //IXMLTV_PARSER _xmltv;
19              if (!Internals.VerifyInstance<IXMLTV_PARSER>(xmltv, out _xmltv)) { return; }              //if (!Internals.VerifyInstance<IXMLTV_PARSER>(xmltv, out _xmltv)) { return; }
20              XMLTV_PARSER = _xmltv;              //XMLTV_PARSER = _xmltv;
21                instance = xmltv;
22              Create();              Create();
23          }          }
24                
25          #region IXMLTVSource          #region IXMLTVSource
26          private IXMLTV_PARSER XMLTV_PARSER { get; set; }          //private IXMLTV_PARSER XMLTV_PARSER { get; set; }
27          public string SourceName { get { return entries[XMLTV_CONSTANTS.Source.SourceName]; } }          public string SourceName { get { return entries[XMLTVConstants.Source.SourceName]; } }
28          public string GeneratorName { get { return entries[XMLTV_CONSTANTS.Source.GeneratorName]; } }          public string GeneratorName { get { return entries[XMLTVConstants.Source.GeneratorName]; } }
29          public string GeneratorUrl { get { return entries[XMLTV_CONSTANTS.Source.GeneratorUrl]; } }          public string GeneratorUrl { get { return entries[XMLTVConstants.Source.GeneratorUrl]; } }
30          #endregion          #endregion
31    
32          private void Create()          private void Create()
33          {          {
34              var doc = XMLTV_PARSER.XMLTV_LOADER.XmlDoc;              var doc = instance.XmlDoc;
35              Debug.Assert(doc.Root.Name == XMLTV_CONSTANTS.ROOT_ELEMENT, string.Format("Expected Root Element: '{0}' but read: '{1}'", XMLTV_CONSTANTS.ROOT_ELEMENT, doc.Root.Name));              Debug.Assert(doc.Root.Name == XMLTVConstants.ROOT_ELEMENT, string.Format("Expected Root Element: '{0}' but read: '{1}'", XMLTVConstants.ROOT_ELEMENT, doc.Root.Name));
36              XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("\tRoot: {0}", doc.Root.Name);              XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("\tRoot: {0}", doc.Root.Name);
37              var attributes = doc.Root.Attributes().ToList();              var attributes = doc.Root.Attributes().ToList();
38              foreach (var attribute in attributes)              foreach (var attribute in attributes)

Legend:
Removed from v.31  
changed lines
  Added in v.36

  ViewVC Help
Powered by ViewVC 1.1.22