Inheritance: IIndexable
示例#1
0
        public void AddTask()
        {
            var task = new Task ();
            task.Title = String.Empty;

            var project = SelectedProject;
            if (project != null)
                task.ProjectId = project.Id;

            var command = new AddTaskCommand (task, m_storage);
            var commands = ServiceManager.Get<CommandService> ().Commands;
            commands.Do (command);

            /* XXX: Our closure uses the index rather than a reference to the
             *   path because there is a GC issue with the closure and GtkPath
             *   instances.
             */
            int index = 0;
            m_tasksTreeView.Model.Foreach (delegate (TreeModel model, TreePath p, TreeIter i) {
                index = p.Indices [0];
                return false;
            });

            var path = new TreePath (new int[] {index});
            m_tasksTreeView.SetCursor (path, task_title_column, true);
        }
示例#2
0
 public AddTaskCommand(Task task, IStorage<Task> storage)
 {
     m_task = task;
     m_storage = storage;
 }
示例#3
0
 public void AddTask(Task task)
 {
     task.Changed += Task_OnChanged;
     this.m_Tasks.Add (task);
     if (this.TaskAdded != null)
         this.TaskAdded (this, new TaskArgs () {Task = task});
 }
示例#4
0
 public void InsertTask(int index, Task task)
 {
     task.Changed += Task_OnChanged;
     this.m_Tasks.Insert (index, task);
     if (this.TaskAdded != null)
         this.TaskAdded (this, new TaskArgs () {Task = task});
 }
示例#5
0
 public void RemoveTask(Task task)
 {
     task.Changed -= Task_OnChanged;
     this.m_Tasks.Remove (task);
     if (this.TaskRemoved != null)
         this.TaskRemoved (this, new TaskArgs () {Task = task});
 }