private static Paragraph AddComments(Topic topic, DocX doc, Paragraph p) { if (topic.Markup.Comments == null) { return(p); } List <BCFComment> sortedComment = topic.Markup.Comments.OrderBy(x => x.Date).ToList(); foreach (BCFComment comment in sortedComment) { p = AddLine("Comment created ", "on ", comment.Date.ToString(), " by ", comment.Author, p, doc); p.StyleName = "Heading2"; p = AddLine("Status: ", "", comment.Status, " - ", comment.VerbalStatus, p, doc); p = AddLine("", "", comment.Comment, "", "", p, doc); p = AddLine("Comment modified ", "on ", comment.ModifiedDate.ToString(), " by ", comment.ModifiedAuthor, p, doc); if (comment.Viewpoint != null) { List <BCFViewpoint> viewpoints = topic.Markup.Viewpoints.Where(viewpoint => viewpoint.ID == comment.Viewpoint.ID).ToList(); if (viewpoints.Count != 0) { BCFViewpoint viewpoint = viewpoints.FirstOrDefault(); p = AddPicture(topic, viewpoint.Snapshot, doc, p); } } p = doc.InsertParagraph(""); } return(p); }
public static MarkupXMLFile BuildMarkupObject() { MarkupXMLFile xmlObj = new MarkupXMLFile(); BCFComment comment = new BCFComment(Guid.NewGuid(), Guid.NewGuid(), "testStatus", DateTime.Now, "testAuthor", "testComment"); comment.ModifiedAuthor = "testModifiedAuthor"; comment.ModifiedDate = DateTime.Now; comment.ReplyToComment = new AttrIDNode(Guid.NewGuid()); comment.Viewpoint = new AttrIDNode(Guid.NewGuid()); comment.VerbalStatus = "testVerbalStatus"; xmlObj.Comments.Add(comment); BCFViewpoint viewp = new BCFViewpoint(Guid.NewGuid()); viewp.Snapshot = "testSnapshot.png"; viewp.Viewpoint = "testFilename.bcfv"; xmlObj.Viewpoints.Add(viewp); xmlObj.Header = new BCFHeader(); BCFFile f = new BCFFile(); f.Date = DateTime.Now; f.Filename = "testFilename"; f.IfcProject = "IfcGuid______________1"; f.IfcSpatialStructureElement = "IfcGuid______________1"; f.isExternal = false; f.Reference = "testReference"; xmlObj.Header.Files.Add(f); xmlObj.Topic = new BCFTopic(Guid.NewGuid(), "testTitle"); xmlObj.Topic.AssignedTo = "testAssignedTo"; xmlObj.Topic.BimSnippet = new BCFBimSnippet("testSnippetType", "testReference"); xmlObj.Topic.BimSnippet.isExternal = true; xmlObj.Topic.BimSnippet.ReferenceSchema = "testReferenceSchema"; return(xmlObj); }