private void AddBookmark(string text, TextRenderData first, TextRenderData last, Color color) { BookmarkModel bookmark = _bookmarkRepository.AddBookmark( ViewModel.BookId, PageCanvas.Bookmarks, text, ColorHelper.ToInt32(color), first.TokenID, last.TokenID); var previousPageWord = PageCanvas.PreviousTexts.LastOrDefault() ?? new TextRenderData(); if(first.TokenID == previousPageWord.TokenID) { PageCanvas.Highlight(PageCanvas.GetPrevPagePanel(), previousPageWord.Rect, previousPageWord.Rect, bookmark, color); } var nextPageWord = PageCanvas.NextTexts.FirstOrDefault() ?? new TextRenderData(); if(last.TokenID == nextPageWord.TokenID) { PageCanvas.Highlight(PageCanvas.GetNextPagePanel(), nextPageWord.Rect, nextPageWord.Rect, bookmark, color); } PageCanvas.Highlight(PageCanvas.GetCurrentPagePanel(), first.Rect, last.Rect, bookmark, color); }
private void InitTextSelection(TextRenderData word, TextRenderData wordContinuation) { AppBar.Close(); PageCanvas.Manipulator.Pause(); PageCanvas.SetSelection(word, wordContinuation); ManipulationService.SetManipulationListener(PageCanvas, _textManipulationListener); TouchPanel.EnabledGestures = GestureType.FreeDrag; AppBar.Visibility = Visibility.Collapsed; PageCanvas.ShowActionButtons(); }
private void AddBookmark(string text, TextRenderData first, TextRenderData last) { ColorSelector.Show(); ClearTextSelection(); ManipulationService.SetManipulationListener(PageCanvas, _dummyManipulationListenner); _bookmarkText = text; _bookmarkFirstTextContext = first; _bookmarkLastTextContext = last; }
private void OnTextManipulatonStated(object sender, ManipulationStartedEventArgs e) { Point manipulationPoint = GetManipulationPoint(e.ManipulationOrigin, e.ManipulationContainer); _firstWord = PageCanvas.FirstSelectionText; _lastWord = PageCanvas.LastSelectionText; double num1 = _firstWord.Rect.DistanceTo(manipulationPoint); double num2 = _lastWord.Rect.DistanceTo(manipulationPoint); if (num1 > num2) { TextRenderData textContext = _firstWord; _firstWord = _lastWord; _lastWord = textContext; num1 = num2; } _textManipulationStarted = num1 < 30.0; }