/[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/10 16:07:38	115
+++ trunk/xmltv_parser/main.cs	2013/03/10 16:09:35	116
@@ -258,7 +258,16 @@
                 gLog.Error.WriteLine(ex.ToString());
             }
         }
-
+        private void DeserializeDataToFile(object filename)
+        {
+            if (filename == null) { throw new ArgumentNullException("filename", "cannot be null"); }
+            if (!XMLTV.Serialize(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);
+        }
         private void mnuItemSaveData_Click(object sender, EventArgs e)
         {
             try
@@ -266,12 +275,7 @@
                 var result = xmltv_program_data_saver.ShowDialog();
                 if (result != DialogResult.OK) return;
                 string filename = xmltv_program_data_saver.FileName;
-                if (!XMLTV.Serialize(filename))
-                {
-                    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);
+                Thread worker = new Thread(new ParameterizedThreadStart(DeserializeDataToFile)); worker.Start(filename);
             }
             catch (Exception ex)
             {

 

  ViewVC Help
Powered by ViewVC 1.1.22