Esempio n. 1
0
        public PDFHandLayer(PDFRendererControl pdf_renderer_control, int page)
        {
            WPFDoEvents.AssertThisCodeIsRunningInTheUIThread();

            this.page = page;
            this.pdf_renderer_control = new WeakReference <PDFRendererControl>(pdf_renderer_control);

            InitializeComponent();

            Background = Brushes.Transparent;
            Cursor     = Cursors.Hand;

            PDFRendererControlStats pdf_renderer_control_stats = pdf_renderer_control.GetPDFRendererControlStats();

            int start_page_offset = pdf_renderer_control_stats.StartPageOffset;

            if (0 != start_page_offset)
            {
                ObjPageNumberControl.SetPageNumber(String.Format("{2} ({0}/{1})", page, pdf_renderer_control_stats.pdf_document.PageCountAsString, (page + start_page_offset - 1)));
            }
            else
            {
                ObjPageNumberControl.SetPageNumber(String.Format("{0}/{1}", page, pdf_renderer_control_stats.pdf_document.PageCountAsString));
            }

            MouseDown += PDFHandLayer_MouseDown;
            MouseUp   += PDFHandLayer_MouseUp;
            MouseMove += PDFHandLayer_MouseMove;

            //Unloaded += PDFHandLayer_Unloaded;
            Dispatcher.ShutdownStarted += Dispatcher_ShutdownStarted;
        }
        public PDFHandLayer(PDFRendererControlStats pdf_renderer_control_stats, int page, PDFRendererControl pdf_renderer_control)
        {
            this.pdf_renderer_control_stats = pdf_renderer_control_stats;
            this.page = page;
            this.pdf_renderer_control = pdf_renderer_control;

            InitializeComponent();

            Background = Brushes.Transparent;
            Cursor     = Cursors.Hand;

            int start_page_offset = pdf_renderer_control_stats.StartPageOffset;

            if (0 != start_page_offset)
            {
                ObjPageNumberControl.SetPageNumber(String.Format("{2} ({0}/{1})", page, pdf_renderer_control_stats.pdf_document.PDFRenderer.PageCount, (page + start_page_offset - 1)));
            }
            else
            {
                ObjPageNumberControl.SetPageNumber(String.Format("{0}/{1}", page, pdf_renderer_control_stats.pdf_document.PDFRenderer.PageCount));
            }

            MouseDown += PDFHandLayer_MouseDown;
            MouseUp   += PDFHandLayer_MouseUp;
            MouseMove += PDFHandLayer_MouseMove;
        }