/[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

--- trunk/libxmltv/Core/XMLTVSource.cs	2013/03/09 11:28:41	77
+++ trunk/libxmltv/Core/XMLTVSource.cs	2013/03/10 18:19:12	120
@@ -6,6 +6,7 @@
 using System.Diagnostics;
 using System.Xml.Linq;
 using System.Reflection;
+using System.IO;
 
 namespace libxmltv.Core
 {
@@ -26,19 +27,30 @@
         //    this.GeneratorName = generatorname;
         //    this.GeneratorUrl = generatorurl;
         //}
+
+
+        public object CreateBindableDataSource()
+        {
+            throw new NotImplementedException();
+        }
+
         public XMLTVSource()
-            : base(null, XMLTVConstants.ROOT_ELEMENT) 
+            : base(null, XMLTVConstants.Root.RootElement) 
         {
             this.SourceName = string.Empty;
             this.GeneratorName = string.Empty;
             this.GeneratorUrl = string.Empty;
         }
-        public XMLTVSource(XMLTVRuntimeInstance instance) : base(instance, XMLTVConstants.ROOT_ELEMENT)
+        public XMLTVSource(XMLTVRuntimeInstance instance)
+            : base(instance, XMLTVConstants.Root.RootElement)
         {
+            try {
             xmltv_logger.Verbose.Debug.WriteLine("Creating Instance of XMLTVSource");
             Create();
             xmltv_logger.Verbose.Debug.WriteLine("Created Instance of XMLTVSource '{0}'", SourceName);
             UpdateInstance();
+            }
+            catch (IOException ex) { Debug.WriteLine(ex.ToString()); }
         }
 
         private void UpdateInstance()
@@ -80,7 +92,7 @@
         private void Create()
         {
             var doc = XDocument.Parse(this.GetInstance().XmlDoc);
-            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));
             //xmltv_logger.Verbose.Debug.WriteLine("\tRoot: {0}", doc.Root.Name);
             var attributes = doc.Root.Attributes().ToList();
             foreach (var attribute in attributes)
@@ -107,6 +119,6 @@
         //public object Clone()
         //{
         //    return new XMLTVSource(this.SourceName, this.GeneratorName, this.GeneratorUrl);
-        //}
+        //}   
     }
 }

 

  ViewVC Help
Powered by ViewVC 1.1.22