Exemplo n.º 1
0
        private void SourceCodeBox_TextChanged(object sender, TextChangedEventArgs e)
        {
            var document = SourceCodeBox.Document;
            var code = new TextRange(document.ContentStart, document.ContentEnd).Text;
            var linesCount = code.Lines();

            if (LineNumbersBox.Text.Lines() == linesCount) return;

            LineNumbersBox.Text = "";
            for (var i = 0; i < linesCount - 1; i++)
            {
                LineNumbersBox.Text += i + 1 + "\n";
            }
        }