ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/xmltv_parser/trunk/xmltv_parser/main.cs
(Generate patch)

Comparing trunk/xmltv_parser/main.cs (file contents):
Revision 117 by william, Sun Mar 10 17:10:47 2013 UTC vs.
Revision 118 by william, Sun Mar 10 17:41:52 2013 UTC

--- trunk/xmltv_parser/main.cs	2013/03/10 17:10:47	117
+++ trunk/xmltv_parser/main.cs	2013/03/10 17:41:52	118
@@ -154,6 +154,8 @@ namespace xmltv_parser
             //    Programs = new List<IXMLTVProgram>(program_list.ToArray());
             //}
             //CreateControls();
+
+            CreateControls();
         }
 
 
@@ -210,6 +212,8 @@ namespace xmltv_parser
             //}
 
             //lstPrograms.Items.AddRange(items.ToArray());
+
+
         }
 
         private void mnuItemOpenXMLTVFile_Click(object sender, EventArgs e)
@@ -232,14 +236,8 @@ namespace xmltv_parser
 
         private void DeserializeDataFromFile(object filename)
         {
-            if (filename == null) { throw new ArgumentNullException("filename", "cannot be null"); }            
-            
-            if (!XMLTV.Load(filename.ToString()))
-            {
-                MessageBox.Show("Failed to load data - check log", "Failed to load data", MessageBoxButtons.OK, MessageBoxIcon.Error);
-                return;
-            }
-            MessageBox.Show("Successfully loaded data", "Successfully loaded data", MessageBoxButtons.OK, MessageBoxIcon.Information);
+            if (filename == null) { throw new ArgumentNullException("filename", "cannot be null"); }
+            XMLTV.Load(filename.ToString(), new EventHandler<EventArgs>(XMLTV_OnInstanceCreated));
         }
 
         private void mnuItemOpenSavedData_Click(object sender, EventArgs e)
@@ -259,12 +257,7 @@ namespace xmltv_parser
         private void DeserializeDataToFile(object filename)
         {
             if (filename == null) { throw new ArgumentNullException("filename", "cannot be null"); }
-            if (!XMLTV.Save(filename.ToString()))
-            {
-                MessageBox.Show("Failed to save data - check log", "Failed to save data", MessageBoxButtons.OK, MessageBoxIcon.Error);
-                return;
-            }
-            MessageBox.Show("Successfully saved data", "Successfully saved data", MessageBoxButtons.OK, MessageBoxIcon.Information);
+            XMLTV.Save(filename.ToString());
         }
         private void mnuItemSaveData_Click(object sender, EventArgs e)
         {