private void drag_area_tracker_OnDragComplete(bool button_left_pressed, bool button_right_pressed, Point mouse_down_point, Point mouse_up_point) { if (button_left_pressed) { WordList selected_words = text_selection_manager.OnDragComplete(button_left_pressed, button_right_pressed, mouse_down_point, mouse_up_point); ReflectWordList(selected_words); } string selected_text = text_selection_manager.GetLastSelectedWordsString(); if (selected_text.Length > 0) { PDFRendererControl pdf_renderer_control = GetPDFRendererControl(); if (pdf_renderer_control != null) { if (button_right_pressed) { PDFDocument pdf_document = pdf_renderer_control?.GetPDFDocument(); ASSERT.Test(pdf_document != null); PDFTextSelectPopup popup = new PDFTextSelectPopup(selected_text, pdf_document); popup.Open(); } pdf_renderer_control.OnTextSelected(selected_text); } } }
private void BuildWords() { ClearChildren(); PDFRendererControl pdf_renderer_control = GetPDFRendererControl(); PDFDocument pdf_document = pdf_renderer_control?.GetPDFDocument(); ASSERT.Test(pdf_document != null); if (pdf_document != null) { WordList words = pdf_document.GetOCRText(page); if (null == words) { Children.Add(new OCRNotAvailableControl()); } else { foreach (var t in Children.OfType <OCRNotAvailableControl>()) { Children.Remove(t); break; } } } }
private void drag_area_tracker_OnDragStarted(bool button_left_pressed, bool button_right_pressed, Point mouse_down_point) { PDFRendererControl pdf_renderer_control = GetPDFRendererControl(); PDFDocument pdf_document = pdf_renderer_control?.GetPDFDocument(); ASSERT.Test(pdf_document != null); if (pdf_document != null) { WordList words = pdf_document.GetOCRText(page); text_selection_manager.OnDragStarted(text_layer_selection_mode, words, ActualWidth, ActualHeight, button_left_pressed, button_right_pressed, mouse_down_point); } }