示例#1
0
 void CreateNodeTask(object obj)
 {
     //create a blank task
     m_Task.Add(new Task("", "", ""));
     //set the task location so its in the view
     m_Task.database[m_Task.database.Count - 1].taskPosition = new Rect(scrollPosition.x,
                                                                        m_Task.database[m_Task.database.Count - 1].taskPosition.y,
                                                                        m_Task.database[m_Task.database.Count - 1].taskPosition.size.x,
                                                                        m_Task.database[m_Task.database.Count - 1].taskPosition.size.y);
     Repaint();
 }
示例#2
0
        private void newTaskTextBox_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Return)
            {
                TreeViewItem group = new TreeViewItem();
                group.Header = "Today";

                UserTask task = new UserTask();
                task.Subject = newTaskTextBox.Text;

                AddTask(task, group, true);
                TaskDatabase.Add(task);

                if (TasksView.ApplicationTasksView != null)
                {
                    NewTaskCommand.Execute(task, TasksView.ApplicationTasksView);
                }

                NewTaskCommand.MassExecute(task, LoadedTasksPeekContents, this);

                newTaskTextBox.Clear();
            }
        }