示例#1
0
        /// <summary>
        /// Mouse is double clicked in viewer.
        /// </summary>
        private void AnnotationTool_MouseDoubleClick(object sender, Vintasoft.Imaging.UI.VisualTools.VisualToolMouseEventArgs e)
        {
            if (CommentTool != null && e.Button == AnnotationTool.ActionButton)
            {
                // find annnotation view
                AnnotationView view = AnnotationTool.FindAnnotationView(e.X, e.Y);

                // if annotation contains the annotation
                if (view != null && view.Data.Comment != null)
                {
                    // get annotation comment
                    Comment comment = view.Data.Comment;
                    // find comment control
                    ICommentControl commentControl = CommentTool.FindCommentControl(comment);

                    // if comment control is found
                    if (commentControl != null)
                    {
                        if (CommentTool.SelectedComment != commentControl)
                        {
                            CommentTool.SelectedComment = commentControl;
                        }

                        // open comment
                        comment.IsOpen = true;
                    }
                }
            }
        }
示例#2
0
        public void GetsAllAnnotations()
        {
            var accessor      = new EpubAccessor(InputFilePath);
            var extractedEpub = accessor.ExtractToFolder(fixture.OutputFolder);

            var annotationTool = new AnnotationTool(extractedEpub);
            var annotations    = annotationTool.GetAnnotations();

            Assert.Equal(5, annotations.Count());
        }
示例#3
0
    static void GeneratePointerSideTriangles(List <int> triangles)
    {
        for (var i = 1; i < k_Sides; i++)
        {
            var lowerLeft  = i - 1;
            var lowerRight = i;
            var upperLeft  = i + k_Sides - 1;
            var upperRight = i + k_Sides;

            var sideTriangles = AnnotationTool.VerticesToPolygon(upperRight, upperLeft, lowerRight, lowerLeft);
            triangles.AddRange(sideTriangles);
        }

        // Finish the side with a polygon that loops around from the end to the start vertices.
        var finishTriangles = AnnotationTool.VerticesToPolygon(k_Sides, k_Sides * 2 - 1, 0, k_Sides - 1);

        triangles.AddRange(finishTriangles);
    }