コード例 #1
0
        private void AddOrReplaceTask(IRtmTask task)
        {
            if (_cachedTasks.Contains(task))
            {
                _cachedTasks.Remove(task);
            }

            _cachedTasks.Add(task);
        }
コード例 #2
0
        public int CompareTo(IRtmTask other)
        {
            if (other == null)
            {
                return(1);
            }

            return(string.Compare(Id, other.Id, StringComparison.Ordinal));
        }
コード例 #3
0
        private IList <IRtmTask> GetSubtasks(IRtmTask parentTask, ICollection <IRtmTask> allTasks)
        {
            var subtasks = allTasks.Where(subtask => string.Equals(parentTask.Id, subtask.ParentTaskId)).ToList();

            foreach (var subtask in subtasks)
            {
                subtask.Subtasks = GetSubtasks(subtask, allTasks);
            }

            return(subtasks);
        }
コード例 #4
0
        public static void WriteTask(IRtmTask task, int indentLevel)
        {
            if (task.HasDueTime)
            {
                Console.WriteLine($"{new string('\t', indentLevel)} {task.Name} Due: {task.Due}");
            }
            else
            {
                Console.WriteLine($"{new string('\t', indentLevel)} {task.Name}");
            }

            foreach (var subtask in task.Subtasks)
            {
                WriteTask(subtask, indentLevel + 1);
            }
        }
コード例 #5
0
 public bool Equals(IRtmTask other)
 {
     return(other != null && string.Equals(Id, other.Id));
 }