Example #1
0
        protected virtual void Dispose(bool disposing)
        {
            Logging.Debug("PDFAnnotationNodeContentControl::Dispose({0}) @{1}", disposing, dispose_count);

            WPFDoEvents.InvokeInUIThread(() =>
            {
                WPFDoEvents.SafeExec(() =>
                {
                    if (dispose_count == 0)
                    {
                        library_index_hover_popup?.Dispose();

                        ToolTipClosing -= PDFDocumentNodeContentControl_ToolTipClosing;
                        ToolTipOpening -= PDFDocumentNodeContentControl_ToolTipOpening;
                    }
                });

                WPFDoEvents.SafeExec(() =>
                {
                    // Clear the references for sanity's sake
                    pdf_annotation_node_content = null;
                    library_index_hover_popup   = null;
                });

                ++dispose_count;
            });
        }
        protected virtual void Dispose(bool disposing)
        {
            Logging.Debug("PDFAnnotationNodeContentControl::Dispose({0}) @{1}", disposing, dispose_count);

            try
            {
                if (dispose_count == 0)
                {
                    library_index_hover_popup?.Dispose();

                    ToolTipClosing -= PDFDocumentNodeContentControl_ToolTipClosing;
                    ToolTipOpening -= PDFDocumentNodeContentControl_ToolTipOpening;
                }

                // Clear the references for sanity's sake
                pdf_annotation_node_content = null;
                library_index_hover_popup   = null;
            }
            catch (Exception ex)
            {
                Logging.Error(ex);
            }

            ++dispose_count;
        }
Example #3
0
        private static void ExpandAnnotations(PDFDocument doc, NodeControl node_control)
        {
            WPFDoEvents.AssertThisCodeIs_NOT_RunningInTheUIThread();
            ASSERT.Test(doc != null);

            FeatureTrackingManager.Instance.UseFeature(Features.Brainstorm_ExploreLibrary_Document_Annotations);

            if (doc != null)
            {
                var annotations = doc.GetAnnotations();

                WPFDoEvents.InvokeInUIThread(() =>
                {
                    WPFDoEvents.AssertThisCodeIsRunningInTheUIThread();

                    foreach (var annotation in annotations)
                    {
                        if (!annotation.Deleted)
                        {
                            PDFAnnotationNodeContent content = new PDFAnnotationNodeContent(doc.LibraryRef.Id, doc.Fingerprint, annotation.Guid.Value);
                            NodeControlAddingByKeyboard.AddChildToNodeControl(node_control, content, false);
                        }
                    }
                });
            }
        }
Example #4
0
        private void ExpandAnnotations()
        {
            FeatureTrackingManager.Instance.UseFeature(Features.Brainstorm_ExploreLibrary_Document_Annotations);

            foreach (var annotation in pdf_document_node_content.PDFDocument.Annotations)
            {
                if (!annotation.Deleted)
                {
                    PDFAnnotationNodeContent content = new PDFAnnotationNodeContent(pdf_document_node_content.PDFDocument.Library.WebLibraryDetail.Id, pdf_document_node_content.PDFDocument.Fingerprint, annotation.Guid.Value);
                    NodeControlAddingByKeyboard.AddChildToNodeControl(node_control, content, false);
                }
            }
        }
Example #5
0
        public PDFAnnotationNodeContentControl(NodeControl node_control, PDFAnnotationNodeContent pdf_annotation_node_content)
        {
            this.pdf_annotation_node_content = pdf_annotation_node_content;
            this.DataContext = pdf_annotation_node_content.PDFAnnotation;

            InitializeComponent();

            this.Focusable = true;

            this.ImageIcon.Source = Icons.GetAppIcon(Icons.BrainstormPDFAnnotation);
            RenderOptions.SetBitmapScalingMode(this.ImageIcon, BitmapScalingMode.HighQuality);

            ImageIcon.Width         = NodeThemes.image_width;
            TextBorder.CornerRadius = NodeThemes.corner_radius;
            TextBorder.Background   = NodeThemes.background_brush;

            this.MouseDoubleClick += PDFAnnotationNodeContentControl_MouseDoubleClick;
            this.ToolTip           = "";
            this.ToolTipClosing   += PDFDocumentNodeContentControl_ToolTipClosing;
            this.ToolTipOpening   += PDFDocumentNodeContentControl_ToolTipOpening;
        }
 public PDFAnnotationNodeEditorControl(NodeControl node_control, PDFAnnotationNodeContent content)
 {
     InitializeComponent();
 }