Пример #1
0
        private void OnAddClicked(object obj, EventArgs args)
        {
            TaskInfoDialog dialog = new TaskInfoDialog();

            switch (dialog.Run())
            {
            case (int)ResponseType.Ok:
                CreateTaskFromDialog(dialog);
                break;

            default:
                break;
            }
            dialog.Destroy();
        }
Пример #2
0
        private void CreateTaskFromDialog(TaskInfoDialog dialog)
        {
            Task task = new Task();

            task.StartingHour   = dialog.StartingHour;
            task.StartingMinute = dialog.StartingMinute;
            task.EndingHour     = dialog.EndingHour;
            task.EndingMinute   = dialog.EndingMinute;
            task.Day            = (WeekDay)Enum.Parse(typeof(WeekDay), dialog.Day);
            task.Priority       = (TaskPriority)Enum.Parse(typeof(TaskPriority), dialog.Priority);
            task.Description    = dialog.Description;
            double x1, x2, y1, y2;

            Task2Coordinates(task, out x1, out x2, out y1, out y2);
            SelectableTask seltask = new SelectableTask(canvas.Root(), task);

            seltask.X1 = x1;
            seltask.Y1 = y1;
            seltask.X2 = x2;
            seltask.Y2 = y2;
        }