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 - 1, Console.WindowWidth); _view.SelectedLineChanged += delegate { UpdateHeader(); }; _footer = new Label(Console.WindowHeight - 1, 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); } }
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); } }