Beispiel #1
0
 public Task Import(Stream xmlData, bool append)
 {
     return(Task.Run(() =>
     {
         var import = EntitySerializer.Deserialize <ToDoItem[]>(xmlData);
         if (append)
         {
             _db.Todo.Save(import);
         }
         else
         {
             _db.Todo.DeleteAll();
             _db.Todo.Save(import);
         }
         _application.CurrentDispatcher.Invoke(() =>
         {
             Pending.Clear();
             Pending.AddRange(_db.Todo.GetUncompleted());
             Completed.Clear();
             Completed.AddRange(_db.Todo.GetCompleteded());
         });
     }));
 }