Пример #1
0
 public AnnotationAppearance(Datalogics.PDFL.Document doc, Datalogics.PDFL.Annotation ann)
 {
     document   = doc;
     annotation = ann;
     properties = new AnnotationProperties();
     ReadProperties();
 }
        void docView_DocumentChanged(object sender, EventArgs e)
        {
            document = docView.Document;
            if (bookmarkManager != null)
            {
                bookmarkManager.DestroyBookmarkTree();
            }
            if (layersManager != null)
            {
                layersManager.DestroyLayers();
            }

            // set the search word for the TextSearchManager to null to force
            // the user to click the search button to search the new document
            textSearchManager.SearchString = "";

            bool show1 = true;
            bool show2 = true;

            if (tabControl.Controls.Contains(bookmarkControl))
            {
                tabControl.Controls.Remove(bookmarkControl);
            }
            if (tabControl.Controls.Contains(layersControl))
            {
                tabControl.Controls.Remove(layersControl);
            }

            bookmarkManager.CreateBookmarkTree(docView.Document);
            layersManager.CreateLayerItems(docView.Document);

            if (bookmarkManager.numberOfBookmarks > 0)
            {
                tabControl.Controls.Add(bookmarkControl);
            }
            else
            {
                show1 = false;
            }
            if (layersManager.layersInDocument.Count > 0)
            {
                tabControl.Controls.Add(layersControl);
            }
            else
            {
                show2 = false;
            }
            showPanel = show1 || show2;

            if (document != null)
            {
                changeZoomLevel(zoomManager.zoomArray.Length - 1);
            }
            ResizeControls();
            horizontalScrollBar.Value = 0;
            verticalScrollBar.Value   = 0;
            if (DocumentChanged != null)
            {
                DocumentChanged(this, null);
            }
        }