/// <summary> /// Increase the indent /// </summary> public void PushIndent(string indent = "\t") { if ((indent == null)) { throw new ArgumentNullException("indent"); } _currentIndentField = (_currentIndentField + indent); IndentLengths.Add(indent.Length); }
/// <summary> /// Increase the indent /// </summary> public void PushIndent(string indent) { if (indent == null) { throw new ArgumentNullException(nameof(indent)); } CurrentIndent = CurrentIndent + indent; IndentLengths.Add(indent.Length); }
/// <summary> /// Increase the indent /// </summary> public T PushIndent(string indent) { if (indent == null) { throw new ArgumentNullException("indent"); } _currentIndent = _currentIndent + indent; IndentLengths.Add(indent.Length); return((T)this); }
/// <summary> /// Remove the last indent that was added with PushIndent /// </summary> public string PopIndent() { var returnValue = ""; if ((IndentLengths.Count > 0)) { var indentLength = IndentLengths[(IndentLengths.Count - 1)]; IndentLengths.RemoveAt((IndentLengths.Count - 1)); if ((indentLength > 0)) { returnValue = _currentIndentField.Substring((_currentIndentField.Length - indentLength)); _currentIndentField = _currentIndentField.Remove((_currentIndentField.Length - indentLength)); } } return(returnValue); }
/// <summary> /// Remove the last indent that was added with PushIndent /// </summary> public string PopIndent() { var returnValue = ""; if (IndentLengths.Count > 0) { var indentLength = IndentLengths[IndentLengths.Count - 1]; IndentLengths.RemoveAt(IndentLengths.Count - 1); if (indentLength > 0) { returnValue = CurrentIndent.Substring(CurrentIndent.Length - indentLength); CurrentIndent = CurrentIndent.Remove(CurrentIndent.Length - indentLength); } } return(returnValue); }
/// <summary> /// Remove the last indent that was added with PushIndent /// </summary> public string PopIndent() { string returnValue = ""; if (IndentLengths.Count > 0) { int indentLength = IndentLengths[IndentLengths.Count - 1]; IndentLengths.RemoveAt(IndentLengths.Count - 1); if (indentLength > 0) { returnValue = _currentIndentField.Substring(_currentIndentField.Length - indentLength); _currentIndentField = _currentIndentField.Remove(_currentIndentField.Length - indentLength); } } return(returnValue); }
/// <summary> /// Remove the last indent that was added with PushIndent /// </summary> public T PopIndent() { string returnValue = ""; if (IndentLengths.Count > 0) { int indentLength = IndentLengths[IndentLengths.Count - 1]; IndentLengths.RemoveAt(IndentLengths.Count - 1); if (indentLength > 0) { returnValue = _currentIndent.Substring(_currentIndent.Length - indentLength); _currentIndent = _currentIndent.Remove(_currentIndent.Length - indentLength); } } // return returnValue; PopIndentText = returnValue; return((T)this); }
/// <summary> /// Remove any indentation /// </summary> public void ClearIndent() { IndentLengths.Clear(); _currentIndentField = ""; }
/// <summary> /// Remove any indentation /// </summary> public void ClearIndent() { IndentLengths.Clear(); CurrentIndent = ""; }
/// <summary> /// Remove any indentation /// </summary> public T ClearIndent() { IndentLengths.Clear(); _currentIndent = ""; return((T)this); }