Example #1
0
 // Merges single operation to items list
 // and adds operation to operations list.
 public static void Merge(this DataSet data, Operation operation)
 {
     switch (operation.Type)
     {
         case OperationType.Create:
             data.CreateItem(operation);
             break;
         case OperationType.Reorder:
             data.ReorderItem(operation);
             break;
         case OperationType.ChangeStatus:
             data.ChangeItemStatus(operation);
             break;
     }
 }
Example #2
0
 // Merges list of operations to ItemViewModel collection.
 public static void Merge(this ObservableCollection<ItemViewModel> items, List<Operation> operations, Action<Item> onStatusChanged)
 {
     foreach (var operation in operations)
     {
         switch (operation.Type)
         {
             case OperationType.Create:
                 items.CreateItem(operation, onStatusChanged);
                 break;
             case OperationType.Reorder:
                 items.MoveItem(operation);
                 break;
             case OperationType.ChangeStatus:
                 items.ChangeItemStatus(operation);
                 break;
         }
     }
 }