コード例 #1
0
ファイル: TasksQueue.cs プロジェクト: VGBenjamin/AutoRenamer
        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
ファイル: TasksQueue.cs プロジェクト: VGBenjamin/AutoRenamer
        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;
        }