Beispiel #1
0
 public override bool Show(DisplayTextPoint point, HowToShow howToShow)
 {
     if (howToShow == HowToShow.AsIs)
     {
         _textView.ViewScroller.EnsureSpanVisible(new SnapshotSpan(point.AdvancedTextPoint, 0), EnsureSpanVisibleOptions.MinimumScroll);
     }
     else if (howToShow == HowToShow.Centered)
     {
         _textView.ViewScroller.EnsureSpanVisible(new SnapshotSpan(point.AdvancedTextPoint, 0), EnsureSpanVisibleOptions.AlwaysCenter);
     }
     else if (howToShow == HowToShow.OnFirstLineOfView)
     {
         _textView.DisplayTextLineContainingBufferPosition(point.AdvancedTextPoint, 0.0, ViewRelativePosition.Top);
     }
     return(point.IsVisible);
 }
Beispiel #2
0
        public override VisibilityState Show(DisplayTextRange textRange, HowToShow howToShow)
        {
            if (howToShow == HowToShow.AsIs)
            {
                _textView.ViewScroller.EnsureSpanVisible(textRange.AdvancedTextRange, EnsureSpanVisibleOptions.MinimumScroll);
            }
            else if (howToShow == HowToShow.Centered)
            {
                _textView.ViewScroller.EnsureSpanVisible(textRange.AdvancedTextRange, EnsureSpanVisibleOptions.AlwaysCenter);
            }
            else if (howToShow == HowToShow.OnFirstLineOfView)
            {
                _textView.DisplayTextLineContainingBufferPosition(textRange.AdvancedTextRange.Start, 0.0, ViewRelativePosition.Top);
            }

            return(textRange.Visibility);
        }
Beispiel #3
0
 /// <summary>
 /// When implemented in a derived class, shows the <paramref name="textRange"/> in the view.
 /// </summary>
 /// <param name="textRange">The <see cref="TextRange"/> to  display.</param>
 /// <param name="howToShow">How the point should be displayed on the screen.</param>
 /// <returns>The <see cref="VisibilityState"/> that describes how the range was actually displayed.</returns>
 public abstract VisibilityState Show(DisplayTextRange textRange, HowToShow howToShow);
Beispiel #4
0
 /// <summary>
 /// When implemented in a derived class, shows the <paramref name="point"/> in the view.
 /// </summary>
 /// <param name="point">The point to  display.</param>
 /// <param name="howToShow">How the point should be displayed on the screen.</param>
 /// <returns><c>true</c> if the point was actually displayed, otherwise <c>false</c>.</returns>
 public abstract bool Show(DisplayTextPoint point, HowToShow howToShow);