示例#1
0
    /// <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;
    }
示例#2
0
      /// <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);
        }
      }
示例#3
0
 /// <summary>
 /// Adds the specified todo.
 /// </summary>
 /// <param name="todo">The todo.</param>
 public void Add(ToDo todoItem) {
   Persistence.Persist.Data.TodoList.Add(todoItem);
   Persist();
 }
示例#4
0
    /// <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;
    }
示例#5
0
 /// <summary>
 /// Clears the time sheet object.
 /// </summary>
 private void ClearToDoObject(){
   _todoItem = null;
 }
示例#6
0
 /// <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();
 }