/[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 77 by william, Sat Mar 9 11:28:41 2013 UTC revision 120 by william, Sun Mar 10 18:19:12 2013 UTC
# Line 6  using libxmltv.Interfaces; Line 6  using libxmltv.Interfaces;
6  using System.Diagnostics;  using System.Diagnostics;
7  using System.Xml.Linq;  using System.Xml.Linq;
8  using System.Reflection;  using System.Reflection;
9    using System.IO;
10    
11  namespace libxmltv.Core  namespace libxmltv.Core
12  {  {
# Line 26  namespace libxmltv.Core Line 27  namespace libxmltv.Core
27          //    this.GeneratorName = generatorname;          //    this.GeneratorName = generatorname;
28          //    this.GeneratorUrl = generatorurl;          //    this.GeneratorUrl = generatorurl;
29          //}          //}
30    
31    
32            public object CreateBindableDataSource()
33            {
34                throw new NotImplementedException();
35            }
36    
37          public XMLTVSource()          public XMLTVSource()
38              : base(null, XMLTVConstants.ROOT_ELEMENT)              : base(null, XMLTVConstants.Root.RootElement)
39          {          {
40              this.SourceName = string.Empty;              this.SourceName = string.Empty;
41              this.GeneratorName = string.Empty;              this.GeneratorName = string.Empty;
42              this.GeneratorUrl = string.Empty;              this.GeneratorUrl = string.Empty;
43          }          }
44          public XMLTVSource(XMLTVRuntimeInstance instance) : base(instance, XMLTVConstants.ROOT_ELEMENT)          public XMLTVSource(XMLTVRuntimeInstance instance)
45                : base(instance, XMLTVConstants.Root.RootElement)
46          {          {
47                try {
48              xmltv_logger.Verbose.Debug.WriteLine("Creating Instance of XMLTVSource");              xmltv_logger.Verbose.Debug.WriteLine("Creating Instance of XMLTVSource");
49              Create();              Create();
50              xmltv_logger.Verbose.Debug.WriteLine("Created Instance of XMLTVSource '{0}'", SourceName);              xmltv_logger.Verbose.Debug.WriteLine("Created Instance of XMLTVSource '{0}'", SourceName);
51              UpdateInstance();              UpdateInstance();
52                }
53                catch (IOException ex) { Debug.WriteLine(ex.ToString()); }
54          }          }
55    
56          private void UpdateInstance()          private void UpdateInstance()
# Line 80  namespace libxmltv.Core Line 92  namespace libxmltv.Core
92          private void Create()          private void Create()
93          {          {
94              var doc = XDocument.Parse(this.GetInstance().XmlDoc);              var doc = XDocument.Parse(this.GetInstance().XmlDoc);
95              Debug.Assert(doc.Root.Name == XMLTVConstants.ROOT_ELEMENT, string.Format("Expected Root Element: '{0}' but read: '{1}'", XMLTVConstants.ROOT_ELEMENT, doc.Root.Name));              Debug.Assert(doc.Root.Name == XMLTVConstants.Root.RootElement, string.Format("Expected Root Element: '{0}' but read: '{1}'", XMLTVConstants.Root.RootElement, doc.Root.Name));
96              //xmltv_logger.Verbose.Debug.WriteLine("\tRoot: {0}", doc.Root.Name);              //xmltv_logger.Verbose.Debug.WriteLine("\tRoot: {0}", doc.Root.Name);
97              var attributes = doc.Root.Attributes().ToList();              var attributes = doc.Root.Attributes().ToList();
98              foreach (var attribute in attributes)              foreach (var attribute in attributes)
# Line 107  namespace libxmltv.Core Line 119  namespace libxmltv.Core
119          //public object Clone()          //public object Clone()
120          //{          //{
121          //    return new XMLTVSource(this.SourceName, this.GeneratorName, this.GeneratorUrl);          //    return new XMLTVSource(this.SourceName, this.GeneratorName, this.GeneratorUrl);
122          //}          //}  
123      }      }
124  }  }

Legend:
Removed from v.77  
changed lines
  Added in v.120

  ViewVC Help
Powered by ViewVC 1.1.22