Changeset 1753 for trunk/eraser6


Ignore:
Timestamp:
2/8/2010 1:24:57 AM (2 years ago)
Author:
lowjoel
Message:

Forward port from Eraser 6.0: Fixed crash when importing a corrupt/outdated task list.

Location:
trunk/eraser6
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser6

  • trunk/eraser6/Eraser/MainForm.cs

    r1736 r1753  
    3434using System.Diagnostics; 
    3535using System.Reflection; 
     36using System.Runtime.Serialization; 
    3637 
    3738namespace Eraser 
     
    258259                        FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) 
    259260                    { 
    260                         Program.eraserClient.Tasks.LoadFromStream(stream); 
     261                        try 
     262                        { 
     263                            Program.eraserClient.Tasks.LoadFromStream(stream); 
     264                        } 
     265                        catch (FileLoadException ex) 
     266                        { 
     267                            MessageBox.Show(S._("The task list could not be imported. The error " + 
     268                                "returned was: {0}", ex.Message), S._("Eraser"), 
     269                                MessageBoxButtons.OK, MessageBoxIcon.Error, 
     270                                MessageBoxDefaultButton.Button1, 
     271                                S.IsRightToLeft(null) ? MessageBoxOptions.RtlReading : 0); 
     272                        } 
     273                        catch (SerializationException ex) 
     274                        { 
     275                            MessageBox.Show(S._("The task list could not be imported. The error " + 
     276                                "returned was: {0}", ex.Message), S._("Eraser"), 
     277                                MessageBoxButtons.OK, MessageBoxIcon.Error, 
     278                                MessageBoxDefaultButton.Button1, 
     279                                S.IsRightToLeft(null) ? MessageBoxOptions.RtlReading : 0); 
     280                        } 
    261281                    } 
    262282                } 
Note: See TracChangeset for help on using the changeset viewer.