/// <summary>
        /// Returns a string with information about annotation data.
        /// </summary>
        /// <param name="annotationData">The annotation data.</param>
        /// <returns>
        /// A string with information about annotation data.
        /// </returns>
        private string GetAnnotationInfo(AnnotationData annotationData)
        {
            if (annotationData == null)
            {
                return("(none)");
            }
            string type = annotationData.GetType().FullName;

            type = type.Replace("Vintasoft.Imaging.Annotation.", "");
            int index = -1;

            if (AnnotationViewer.AnnotationDataCollection != null)
            {
                index = AnnotationViewer.AnnotationDataCollection.IndexOf(annotationData);
            }
            return(string.Format("[{0}]{1}", index, type));
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="AnnotationsInfoForm"/> class.
        /// </summary>
        /// <param name="annotations">The annotations.</param>
        public AnnotationsInfoForm(AnnotationDataController annotations)
        {
            InitializeComponent();

            // for each image in annotation data controller
            for (int i = 0; i < annotations.Images.Count; i++)
            {
                // create view group
                ListViewGroup group = annoInfoListView.Groups.Add("pageNumber", "Page " + (i + 1));
                // for each annotation in current image annotations
                for (int j = 0; j < annotations[i].Count; j++)
                {
                    AnnotationData annot = annotations[i][j];
                    ListViewItem   item  = annoInfoListView.Items.Add(annot.GetType().ToString());
                    item.Group = group;
                    item.SubItems.Add(annot.Location.ToString());
                    item.SubItems.Add(annot.CreationTime.ToString());
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Returns the comment type.
        /// </summary>
        /// <param name="annotation">The parent annotation.</param>
        /// <returns>
        /// The comment type.
        /// </returns>
        public static string GetCommentType(AnnotationData annotation)
        {
            string result = string.Empty;

            if (annotation != null)
            {
                Type type = annotation.GetType();

                if (type == typeof(RectangleAnnotationData))
                {
                    result = "Rectangle";
                }
                else if (type == typeof(EllipseAnnotationData))
                {
                    result = "Ellipse";
                }
                else if (type == typeof(HighlightAnnotationData))
                {
                    result = "Highlight";
                }
                else if (type == typeof(EmbeddedImageAnnotationData))
                {
                    result = "Embedded Image";
                }
                else if (type == typeof(ReferencedImageAnnotationData))
                {
                    result = "Referenced Image";
                }
                else if (type == typeof(TextAnnotationData))
                {
                    result = "Text";
                }
                else if (type == typeof(StickyNoteAnnotationData))
                {
                    result = "Sticky Note";
                }
                else if (type == typeof(FreeTextAnnotationData))
                {
                    result = "Free Text";
                }
                else if (type == typeof(StampAnnotationData))
                {
                    result = "Stamp";
                }
                else if (type == typeof(LinkAnnotationData))
                {
                    result = "Link";
                }
                else if (type == typeof(ArrowAnnotationData))
                {
                    result = "Arrow";
                }
                else if (type == typeof(LineAnnotationData))
                {
                    result = "Line";
                }
                else if (type == typeof(LinesAnnotationData))
                {
                    result = "Lines";
                }
                else if (type == typeof(PolygonAnnotationData))
                {
                    result = "Polygon";
                }
                else if (type == typeof(RulerAnnotationData))
                {
                    result = "Ruler";
                }
                else if (type == typeof(RulersAnnotationData))
                {
                    result = "Rulers";
                }
                else if (type == typeof(AngleAnnotationData))
                {
                    result = "Angle";
                }
                else if (type == typeof(ArcAnnotationData))
                {
                    result = "Arc";
                }
                else if (type == typeof(TriangleAnnotationData))
                {
                    result = "Triangle";
                }
                else if (type == typeof(MarkAnnotationData))
                {
                    result = "Mark";
                }
                else if (type == typeof(GroupAnnotationData))
                {
                    result = "Group";
                }
            }

            return(result);
        }