/// <Summary> Add a Comment in the tree node of the Topic </Summary> /// <param name="parent">Topic owning this comment</param> /// <param name="comment">Comment to be added in tree node of a Topic</param> private BCFTreeNode AddComment(BCFTreeNode parent, BCFmarkup.Comment comment) { BCFTreeNode tn = new BCFTreeNode(); tn.Text = comment.CommentProperty; tn.NodeFile = null; tn.NodeTopic = null; tn.NodeComment = comment; parent.Nodes.Add(tn); return(tn); }
private void pict_DoubleClick(Object sender, EventArgs args) { BCFmarkup.ViewPoint v = null; BCFTreeNode tn = (BCFTreeNode)tree.SelectedNode; if (tn == null) { return; } if (tn.NodeTopic != null) { BCFmarkup.Markup topic = tn.NodeTopic; if (topic.Viewpoints.Count > 0) { v = topic.Viewpoints[0]; } } else if (tn.NodeComment != null) { BCFmarkup.Comment comment = tn.NodeComment; if (comment.Viewpoint != null) { v = comment.MarkupViewPoint; } else { BCFTreeNode tp = (BCFTreeNode)tree.SelectedNode.Parent; BCFmarkup.Markup topic = tp.NodeTopic; if (topic.Viewpoints.Count > 0) { v = topic.Viewpoints[0]; } } } if (v != null) { if (v.Bcfv.CameraDefined()) { if (MoveCamera != null) { MoveCamera(v.Bcfv); } else { MessageBox.Show(v.Bcfv.CameraText(), "Camera:"); } } } }
/// <summary> Fills the details of the selected Comment in the list view and the image </summary> /// <param name="comment">Selected Comment</param> /// <param name="topic">Topic parent of the Comment</param> private void ShowCommentDetails(BCFmarkup.Markup topic, BCFmarkup.Comment comment) { list.Clear(); list.Columns.Add("COMMENT", -1, HorizontalAlignment.Left); list.Columns.Add("", -1, HorizontalAlignment.Left); AddProperty("Comment", comment.CommentProperty); AddProperty("Creation Date", formatDate(comment.Date)); AddProperty("Creation Author", comment.Author); if (comment.ModifiedAuthor != null && comment.ModifiedDate != null) { if (comment.ModifiedAuthor != comment.Author || comment.ModifiedDate != comment.Date) { AddProperty("Modified Date", formatDate(comment.ModifiedDate)); AddProperty("Modified Author", comment.ModifiedAuthor); } } AddProperty("Viewpoint", (comment.Viewpoint != null ? "Yes" : "No")); // Viewpoint BCFmarkup.ViewPoint vp = null; if (comment.Viewpoint != null) { vp = comment.MarkupViewPoint; } else if (topic.Viewpoints.Count > 0) { vp = topic.Viewpoints[0]; } if (vp != null) // Viewpoint-Image { if (vp.Image != null) { pict.Image = vp.Image; ratio = (double)vp.Image.Height / (double)vp.Image.Width; ResizeImage(); } else // No Image { pict.Image = null; } } }