/// <summary> /// Add text to the current <see cref="CodeLine"/> and /// set the current line to a new CodeLine. /// </summary> /// <param name="text">The text to add</param> public void WriteLine(string text) { if (_currentCodeLine != null) { _currentCodeLine.Text += text; _currentCodeLine = null; } else { this.CodeLines.Add(new CodeLine { Indent = _indent, Text = text }); } }
/// <summary> /// Add text to the current <see cref="CodeLine"/> and /// keep it as the current line. /// </summary> /// <param name="text">The text to add</param> public void Write(string text) { if (_currentCodeLine == null) { _currentCodeLine = new CodeLine { Indent = _indent, Text = text }; this.CodeLines.Add(_currentCodeLine); } else { _currentCodeLine.Text += text; } }