private void UpdateInterface() { if (PagesTab.SelectedIndex == -1) { RepeatButton.Enabled = false; BackButton.Enabled = false; RowsNumbers.Text = ""; return; } RepeatButton.Enabled = Pages[PagesTab.SelectedIndex].CanRepeat; BackButton.Enabled = Pages[PagesTab.SelectedIndex].CanCancel; string numbers = ""; int start = CodeField.GetLineFromCharIndex(CodeField.GetCharIndexFromPosition(new Point(0, 0))); int end = CodeField.GetLineFromCharIndex(CodeField.GetCharIndexFromPosition(new Point(CodeField.Size.Width, CodeField.Size.Height))); for (int i = start; i <= end; i++) { numbers += (i + 1) + ":\n"; } RowsNumbers.Text = numbers; codeHandler.HandleText(); }
private void UpdateRowsNumbers() { string numbers = ""; int start = CodeField.GetLineFromCharIndex(CodeField.GetCharIndexFromPosition(new Point(0, 0))); int end = CodeField.GetLineFromCharIndex(CodeField.GetCharIndexFromPosition(new Point(CodeField.Size.Width, CodeField.Size.Height))); for (int i = start; i <= end; i++) { numbers += i + ":\n"; } RowsNumbers.Text = numbers; }