Example #1
0
            public bool WriteTitleContent(TaskList tasks, Task task, HtmlTextWriter html)
            {
                if (!Enabled)
                {
                    return(false);
                }
#if DEBUG
                // Sanity check
                if (!ContainsTaskAttributes(tasks))
                {
                    return(false);
                }
#endif
                if (SeparatePage)
                {
                    html.AddAttribute("class", "title-page");
                }

                String content     = HtmlReportUtils.SubstituteReportDetails(tasks, Text);
                var    custAttribs = HtmlReportUtils.GetCustomAttributes(tasks);

                content = HtmlReportUtils.ReplaceTaskAttributePlaceholders(content, custAttribs, task, 1, false);
                content = HtmlReportUtils.ReplaceTaskAttributePlaceholders(content, custAttribs, task, -1, false);

                html.RenderBeginTag(HtmlTextWriterTag.Div);
                html.Write(content);
                html.RenderEndTag();                 // Div

                return(true);
            }
Example #2
0
            public bool WriteTableContent(TaskList tasks, HtmlTextWriter html)
            {
                // Top-level tasks
                var task = tasks.GetFirstTask();

                if (task == null)
                {
                    return(false);
                }

                if (m_Preview)
                {
                    m_PreviewTaskCount = 0;
                }

                var custAttribs = HtmlReportUtils.GetCustomAttributes(tasks);
                var layout      = m_Template.GetLayout(custAttribs);

                html.RenderBeginTag(HtmlTextWriterTag.Div);
                html.WriteLine(layout.StartHtml);

                WriteTask(task, layout, 1, html);                 // level '0' is used for leaf tasks

                html.WriteLine(layout.EndHtml);
                html.RenderEndTag();                 // Div

                if (m_Preview && (m_PreviewTaskCount >= MaxNumPreviewTasks) && (tasks.GetTaskCount() > m_PreviewTaskCount))
                {
                    html.RenderBeginTag(HtmlTextWriterTag.P);
                    html.WriteLine(m_Trans.Translate("(more tasks not shown...)"));
                    html.RenderEndTag();                     // P
                }

                return(true);
            }
Example #3
0
        //static String CommentsDoneColor = @"#808080";
        //static String Endl = @"\n";

        // -------------------------------------------------------------

        public HtmlReportBuilder(Translator trans, TaskList tasks, Preferences prefs, HtmlReportTemplate template, bool preview)
        {
            m_Tasklist = tasks;
            m_Template = template;

            m_StrikeThruDone = prefs.GetProfileBool("Preferences", "StrikethroughDone", true);
            m_BodyFontStyle  = HtmlReportUtils.FormatBodyFontStyle(prefs);

            Header = new HeaderTemplateReporter(template.Header, template.BackColor);
            Title  = new TitleTemplateReporter(trans, template.Title);
            Footer = new FooterTemplateReporter(template.Footer, template.BackColor);

            var custAttribs = HtmlReportUtils.GetCustomAttributes(tasks);
            var baseIndent  = HtmlReportUtils.FormatTaskBaseIndent(prefs);

            Tasks = new TaskTemplateReporter(trans, template.Task, baseIndent, preview);
        }
Example #4
0
            private Layout PreWriteContent(TaskList tasks, Task task, HtmlTextWriter html)
            {
                if ((task == null) || !task.IsValid())
                {
                    return(null);
                }

                if (m_Preview)
                {
                    m_PreviewTaskCount = 0;
                }

                var custAttribs = HtmlReportUtils.GetCustomAttributes(tasks);
                var layout      = m_Template.GetLayout(custAttribs);

                html.RenderBeginTag(HtmlTextWriterTag.Div);
                html.WriteLine(layout.StartHtml);

                return(layout);
            }