/// <summary> /// Edits the specified todo item. /// </summary> /// <param name="todoItem">The todo item.</param> /// <param name="index">The index.</param> public bool Edit(ToDo todoItem) { bool status = false; int index = FindTodoIndex(todoItem.GUID); if (index != -1) { Persistence.Persist.Data.TodoList[index] = todoItem; Persist(); status = true; } return status; }
/// <summary> /// Adds the todo item. /// </summary> private void AddTodoItem(){ try { if (tbcMain.SelectedTab != tbTodo) { tbcMain.SelectedTab = tbTodo; } ToDo todoItem = new ToDo(); TodoItemForm frm = new TodoItemForm(ref todoItem); frm.ShowDialog(); if (todoItem.GUID != "") { _todoControl.Add(todoItem); PopulateTodoTab(); } } catch (Exception ex) { Utilities.ShowErrorMessage("Error Adding TodoList Item!", ex); } }
/// <summary> /// Adds the specified todo. /// </summary> /// <param name="todo">The todo.</param> public void Add(ToDo todoItem) { Persistence.Persist.Data.TodoList.Add(todoItem); Persist(); }
/// <summary> /// Gets the display name of the time sheet. /// </summary> /// <returns></returns> public string GetTodoItemDisplayName(ToDo todoItem){ string result = string.Empty; if (todoItem.Desc.Length > 60) { result = todoItem.Desc.Substring(0, 60) + "..."; } else { result = todoItem.Desc.Substring(0, todoItem.Desc.Length); } int enterKey = result.IndexOf("\n"); if (enterKey != -1) { result = result.Substring(0, enterKey); result = result + "..."; } return result; }
/// <summary> /// Clears the time sheet object. /// </summary> private void ClearToDoObject(){ _todoItem = null; }
/// <summary> /// Initializes a new instance of the <see cref="frmToDoItem"/> class. /// </summary> /// <param name="todo">The todo.</param> public TodoItemForm(ref ToDo todo){ InitializeComponent(); _todoItem = todo; SetUpTodoItemForm(); }