BringIntoView() public method

public BringIntoView ( int lineIndex ) : void
lineIndex int
return void
Example #1
0
        private void InitializeScreen()
        {
            var oldView = _view;

            _header            = new Label(0, 0, Console.WindowWidth);
            _header.Foreground = ConsoleColor.Yellow;
            _header.Background = ConsoleColor.DarkGray;

            _view = new View(1, 0, Console.WindowHeight - 1, Console.WindowWidth);
            _view.SelectedLineChanged += delegate { UpdateHeader(); };

            _footer            = new Label(Console.WindowHeight - 1, 0, Console.WindowWidth);
            _footer.Foreground = ConsoleColor.Yellow;
            _footer.Background = ConsoleColor.DarkGray;

            Vt100.SetScrollMargins(2, Console.WindowHeight - 1);

            UpdateRepository();

            if (oldView != null)
            {
                _view.VisibleWhitespace = oldView.VisibleWhitespace;
                _view.SelectedLine      = oldView.SelectedLine;
                _view.BringIntoView(_view.SelectedLine);
            }
        }
Example #2
0
        private void GoHome()
        {
            if (_view.DocumentHeight == 0)
            {
                return;
            }

            _view.LeftChar     = 0;
            _view.SelectedLine = 0;
            _view.BringIntoView(_view.SelectedLine);
        }
Example #3
0
 private void GoHome()
 {
     _view.LeftChar     = 0;
     _view.SelectedLine = 0;
     _view.BringIntoView(_view.SelectedLine);
 }
Example #4
0
        private void InitializeScreen()
        {
            var oldView = _view;

            _header = new Label(0, 0, Console.WindowWidth);
            _header.Foreground = ConsoleColor.Yellow;
            _header.Background = ConsoleColor.DarkGray;

            var renderer = new PatchDocumentLineRenderer();
            _view = new View(renderer, 1, 0, Console.WindowHeight - 2, Console.WindowWidth);
            _view.SelectedLineChanged += delegate { UpdateHeader(); };

            _footer = new Label(Console.WindowHeight - 2, 0, Console.WindowWidth);
            _footer.Foreground = ConsoleColor.Yellow;
            _footer.Background = ConsoleColor.DarkGray;

            UpdateRepository();

            if (oldView != null)
            {
                _view.VisibleWhitespace = oldView.VisibleWhitespace;
                _view.SelectedLine = oldView.SelectedLine;
                _view.BringIntoView(_view.SelectedLine);
            }
        }