示例#1
0
 private void MoveDown(Task t)
 {
     MoveBy(t, 1);
 }
示例#2
0
 private void MoveUp(Task t)
 {
     MoveBy(t, -1);
 }
示例#3
0
 private void MoveBy(Task t, int move)
 {
     int listpos = tasks_.IndexOf(t);
     int newpos = listpos + move;
     // Is this a valid new position?
     if (newpos < 0 || newpos >= tasks_.Count)
         return;
     int orderpos = t.Order;
     Task other = tasks_[newpos];
     t.Order = other.Order;
     other.Order = orderpos;
     tasks_.Move(listpos, newpos);
 }