Ejemplo n.º 1
0
        /// <summary>
        /// Render the task.
        /// </summary>
        /// <param name="task">The task.</param>
        /// <returns></returns>
        private string RenderTask(Task task)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendLine("<li class='taskli'>");
            sb.AppendFormat("<div class='theader'>{0}<span class='time'>[{1}]</span></div>", task.Title, OpmaakHelper.Tijd(task.TotalTimeSpent()));
            sb.AppendLine("<div class='tcontent'>");

            switch (mode)
            {
                case StoryAndTasksComponentMode.MyTasks:
                    sb.AppendFormat("<div class='tbuttons'>{0}</div>", RenderMyTasksButtons(task));
                    break;
                case StoryAndTasksComponentMode.TakenTasks:
                    sb.AppendFormat("behandelaar: {0}", task.AssignedUserName);
                    sb.AppendFormat("<div class='tbuttons'>{0}</div>", RenderTakenTasksButtons(task));
                    break;
                case StoryAndTasksComponentMode.ClosedTasks:
                    sb.AppendFormat("<div class='tbuttons'>{0}</div>", RenderClosedTasksButtons(task));
                    break;
                case StoryAndTasksComponentMode.OpenTasks:
                    sb.AppendFormat("<div class='tbuttons'>{0}</div>", RenderOpenTasksButtons(task));
                    break;
                default:
                    throw new ArgumentOutOfRangeException();
            }

            sb.AppendFormat("<div class='ttext'>{0}</div>", RenderMarkdown(task.Description));
            sb.AppendLine("</div>");
            sb.AppendLine("</li>");

            return sb.ToString();
        }