Changeset 1829
- Timestamp:
- 2/12/2010 6:24:18 AM (3 years ago)
- Location:
- trunk/eraser6
- Files:
-
- 5 edited
-
Eraser.Manager/DirectExecutor.cs (modified) (1 diff)
-
Eraser.Manager/Executor.cs (modified) (1 diff)
-
Eraser/MainForm.cs (modified) (1 diff)
-
Eraser/Program.cs (modified) (1 diff)
-
Eraser/SchedulerPanel.cs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/eraser6/Eraser.Manager/DirectExecutor.cs
r1802 r1829 958 958 StreamingContextStates.All, Owner); 959 959 BinaryFormatter formatter = new BinaryFormatter(null, context); 960 List<Task> deserialised = (List<Task>)formatter.Deserialize(stream); 961 list.AddRange(deserialised); 962 963 foreach (Task task in deserialised) 964 { 965 Owner.OnTaskAdded(new TaskEventArgs(task)); 966 if (task.Schedule is RecurringSchedule) 967 Owner.ScheduleTask(task); 960 961 try 962 { 963 List<Task> deserialised = (List<Task>)formatter.Deserialize(stream); 964 list.AddRange(deserialised); 965 966 foreach (Task task in deserialised) 967 { 968 Owner.OnTaskAdded(new TaskEventArgs(task)); 969 if (task.Schedule is RecurringSchedule) 970 Owner.ScheduleTask(task); 971 } 972 } 973 catch (FileLoadException e) 974 { 975 throw new InvalidDataException(e.Message, e); 976 } 977 catch (SerializationException e) 978 { 979 throw new InvalidDataException(e.Message, e); 968 980 } 969 981 } -
trunk/eraser6/Eraser.Manager/Executor.cs
r1802 r1829 177 177 /// tasks instead of overwriting it.</remarks> 178 178 /// <param name="stream">The stream to save to.</param> 179 /// <exception cref="InvalidDataException">Thrown when the data in the stream is 180 /// invalid or unrecognised.</exception> 179 181 public abstract void LoadFromStream(Stream stream); 180 182 -
trunk/eraser6/Eraser/MainForm.cs
r1825 r1829 266 266 Program.eraserClient.Tasks.LoadFromStream(stream); 267 267 } 268 catch (FileLoadException ex) 269 { 270 MessageBox.Show(S._("The task list could not be imported. The error " + 271 "returned was: {0}", ex.Message), S._("Eraser"), 272 MessageBoxButtons.OK, MessageBoxIcon.Error, 273 MessageBoxDefaultButton.Button1, 274 Localisation.IsRightToLeft(this) ? 275 MessageBoxOptions.RtlReading | MessageBoxOptions.RightAlign : 0); 276 } 277 catch (SerializationException ex) 268 catch (InvalidDataException ex) 278 269 { 279 270 MessageBox.Show(S._("The task list could not be imported. The error " + -
trunk/eraser6/Eraser/Program.cs
r1819 r1829 519 519 } 520 520 } 521 catch ( SerializationException ex)521 catch (InvalidDataException ex) 522 522 { 523 523 File.Delete(TaskListPath); -
trunk/eraser6/Eraser/SchedulerPanel.cs
r1802 r1829 436 436 Program.eraserClient.Tasks.LoadFromStream(stream); 437 437 } 438 catch ( SerializationException ex)438 catch (InvalidDataException ex) 439 439 { 440 440 MessageBox.Show(S._("Could not import task list from {0}. The " +
Note: See TracChangeset
for help on using the changeset viewer.
