예제 #1
0
        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);
        }
예제 #2
0
 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();
 }
예제 #3
0
        private void AddBookmark(string text, TextRenderData first, TextRenderData last)
        {
            ColorSelector.Show();
            
            ClearTextSelection();
            ManipulationService.SetManipulationListener(PageCanvas, _dummyManipulationListenner);

            _bookmarkText = text;
            _bookmarkFirstTextContext = first;
            _bookmarkLastTextContext = last;
        }
예제 #4
0
 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;
 }