Exemplo n.º 1
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;
        }
Exemplo n.º 2
0
 private void StartDrawing(EventButton ev)
 {
     if (ev.X >= taskArea.X1 && ev.X <= taskArea.X2 &&
         ev.Y >= taskArea.Y1 && ev.Y <= taskArea.Y2)
     {
         Task task = new Task();
         stask = new SelectableTask(group, task);
         double minRounded = RoundMinutes(firstCell, ev.Y);
         stask.X1            = firstCell.Width * firstCell.Column;
         firstX              = stask.X1;
         stask.Y1            = minRounded;
         firstY              = stask.Y1;
         stask.X2            = firstCell.Width * (firstCell.Column + 1);
         stask.Y2            = stask.Y1 + firstCell.Height / 4;
         task.StartingHour   = firstCell.Row + 8;
         task.StartingMinute = (int)((minRounded - (firstCell.Row * firstCell.Height)) / PlannerWindow.minuteLength);
         task.Priority       = TaskPriority.Medium;
         task.Day            = (WeekDay)firstCell.Column - 1;      //starting on monday = 0
         App.CurrentTaskSet.Add(task);
         TaskList.Add(stask);
     }
 }
Exemplo n.º 3
0
 private void StartDrawing(EventButton ev)
 {
     if (ev.X >= taskArea.X1 && ev.X <= taskArea.X2
             && ev.Y >= taskArea.Y1 && ev.Y <= taskArea.Y2)
     {
         Task task = new Task ();
         stask = new SelectableTask (group, task);
         double minRounded = RoundMinutes (firstCell, ev.Y);
         stask.X1 = firstCell.Width * firstCell.Column;
         firstX = stask.X1;
         stask.Y1 = minRounded;
         firstY = stask.Y1;
         stask.X2 = firstCell.Width * (firstCell.Column + 1);
         stask.Y2 = stask.Y1 + firstCell.Height/4;
         task.StartingHour = firstCell.Row + 8;
         task.StartingMinute = (int)((minRounded - (firstCell.Row * firstCell.Height))/ PlannerWindow.minuteLength);
         task.Priority = TaskPriority.Medium;
         task.Day = (WeekDay)firstCell.Column - 1; //starting on monday = 0
         App.CurrentTaskSet.Add (task);
         TaskList.Add (stask);
     }
 }