/[xmltv_parser]/trunk/xmltv_parser/main.cs
ViewVC logotype

Diff of /trunk/xmltv_parser/main.cs

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

--- trunk/xmltv_parser/main.cs	2013/03/08 05:20:12	49
+++ trunk/xmltv_parser/main.cs	2013/03/08 06:15:44	50
@@ -15,10 +15,11 @@
 
 namespace xmltv_parser
 {
+
     public partial class main : Form
     {
         bool form_closing = false;
-        private IXMLTVRuntimeInstance xmltv;
+        //private IXMLTVRuntimeInstance xmltv;
         private bool IsUnix
         {
             get { return System.Environment.OSVersion.Platform == PlatformID.Unix; }
@@ -96,7 +97,6 @@
         }
         private void main_Shown(object sender, EventArgs e)
         {
-            //libxmltv.Core.XMLTV
             
         }
 
@@ -104,9 +104,8 @@
         void LoadXMLTVShcedule(string schedule_xml)
         {
             XMLTV.CreateInstance(schedule_xml, new EventHandler<CancelEventArgs>(xmltv_cancelevent));
-            xmltv = XMLTV.GetInstance();
-            var program_count = xmltv.Programs.Values.Count;
-            var program_list = xmltv.Programs.Values.ToList().OrderBy(s => s.Start);
+            var program_count = XMLTV.GetInstance().Programs.Values.Count;
+            var program_list = XMLTV.GetInstance().Programs.Values.ToList().OrderBy(s => s.Start);
             //Programs = program_list(0, program_count).ToList();
             Programs = new List<IXMLTVProgram>(program_list.ToArray());
         }
@@ -134,11 +133,11 @@
         }
 
         private void mnuItemOpenXMLTVFile_Click(object sender, EventArgs e)
-        {
-            ClearLocalLog();
+        {   
             //LoadXMLTVShcedule("20130307_continuum_schedule.xml");
             var result = xmltv_file_chooser.ShowDialog();
             if (result != DialogResult.OK) return;
+            ClearLocalLog();
             LoadXMLTVShcedule(xmltv_file_chooser.FileName);
             CreateControls();
         }
@@ -148,7 +147,10 @@
             var result = xmltv_program_data_loader.ShowDialog();
             if (result != DialogResult.OK) return;
             string filename = xmltv_program_data_loader.FileName;
-            if (!XMLTV.GetSerializer().DeSerialize(filename, out xmltv))
+            IXMLTVRuntimeInstance xmltv = null;
+            bool status = false;
+            xmltv = XMLTV.DeSerialize(filename, out status);
+            if (!status)
             {
                 MessageBox.Show("Failed to load data - check log", "Failed to load data", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 return;
@@ -162,7 +164,7 @@
             var result = xmltv_program_data_saver.ShowDialog();
             if (result != DialogResult.OK) return;
             string filename = xmltv_program_data_saver.FileName;
-            if (!XMLTV.GetSerializer().Serialize(filename))
+            if (!XMLTV.Serialize(filename))
             {
                 MessageBox.Show("Failed to save data - check log", "Failed to save data", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 return;

 

  ViewVC Help
Powered by ViewVC 1.1.22