예제 #1
0
 /// <summary>
 /// Returns the html full report for the page.
 /// </summary>
 /// <returns>The full report for the page.</returns>
 public HtmlWriter FullReportHtml()
 {
     return(new HtmlWriter("fullReport")
            .AppendElement("p", "PageHeader", Name)
            .OpenTag("ul", "PageInfoList")
            .AppendElement("li", "PageInfoDateItem", OriginalAssignmentDate.ToString("MM/dd/yyyy"))
            .AppendElement("li", "PageInfoTagItem", "Tag: " + TagName)
            .OpenTag("li", "PageInfoImageCountItem")
            .AppendText(Images.Count + " pages:")
            .OpenTag("ol", "PageInfoImageList")
            .AppendHtml(Images.Select(image => image.FullReportHtml()))
            .CloseAllTags());
 }
예제 #2
0
        /// <summary>
        /// Returns the text full report for the page.
        /// </summary>
        /// <returns>The full report for the page.</returns>
        public string FullReport()
        {
            Indenter indenter =
                new Indenter(Name.PadRight(60) + "(" + OriginalAssignmentDate.ToString("MM/dd/yyyy") + ")")
                .AppendOnSameLine(HasWork && Changed ? " (!)(modified)" : "")
                .AddIndent()
                .Append("Tag: " + TagName)
                .Append(Images.Count + " image(s):")
                .AddIndent("|   ");

            for (int i = 0; i < Images.Count; i++)
            {
                indenter.Append(i + 1 + ") ");
                indenter.AppendOnSameLine(Images[i].FullReport());
            }

            return(indenter.ToString());
        }
예제 #3
0
        /// <summary>
        /// Loads and calculates date information from the page content.
        /// </summary>
        /// <param name="pageXml">The xml document containing the page content.</param>
        void LoadDates(XmlDocument pageXml)
        {
            CreationTime     = DateTime.Parse(pageXml.GetAttribute("dateTime", ""));
            LastModifiedTime = DateTime.Parse(pageXml.GetAttribute("lastModifiedTime", ""));

            LastAssignedTime = DateTime.Parse(Tag?.GetAttribute("creationDate") ?? CreationTime.ToString());

            if (Helpers.IsWeekday(SectionGroup.Name))
            {
                for (OriginalAssignmentDate = CreationTime.Date; OriginalAssignmentDate.ToString("dddd") != SectionGroup.Name.Capitalized();)
                {
                    OriginalAssignmentDate = OriginalAssignmentDate.AddDays(1);
                }
            }
            else
            {
                OriginalAssignmentDate = LastAssignedTime.Date;
            }
        }