예제 #1
0
        public void MoveDown(ITask task)
        {
            int index = TasksList.IndexOf(task);

            if (index < 0)
            {
                throw new KeyNotFoundException($"The status detail Id: {task.TaskId} is not found in the task list");
            }

            if (index < TasksList.Count - 1)
            {
                TasksList.Swap(index, index + 1);
            }
        }
예제 #2
0
        public void MoveUp(ITask task)
        {
            int index = TasksList.IndexOf(task);

            if (index < 0)
            {
                throw new KeyNotFoundException($"The task Id: {task.TaskId} is not found in the task list");
            }

            if (index > 0)
            {
                TasksList.Swap(index, index - 1);
            }
        }
예제 #3
0
        private void Row_DoubleClick(object sender, MouseButtonEventArgs e)
        {
            DataGridRow row        = (DataGridRow)sender;
            Task        targetTask = (Task)row.Item;
            int         index      = TasksList.IndexOf(targetTask);

            Editting = true;

            if (OpenTaskDetails(ref targetTask))
            {
                TasksList[index] = targetTask;
                TaskGrid.Items.Refresh();
            }
            Editting = false;
        }