Ejemplo n.º 1
0
 /// <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);
 }
Ejemplo n.º 2
0
 /// <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);
 }
Ejemplo n.º 3
0
 /// <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);
 }
Ejemplo n.º 4
0
        /// <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);
        }
Ejemplo n.º 5
0
        /// <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);
        }
Ejemplo n.º 6
0
        /// <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);
        }
Ejemplo n.º 7
0
        /// <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);
        }
Ejemplo n.º 8
0
 /// <summary>
 /// Remove any indentation
 /// </summary>
 public void ClearIndent()
 {
     IndentLengths.Clear();
     _currentIndentField = "";
 }
Ejemplo n.º 9
0
 /// <summary>
 ///     Remove any indentation
 /// </summary>
 public void ClearIndent()
 {
     IndentLengths.Clear();
     CurrentIndent = "";
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Remove any indentation
 /// </summary>
 public T ClearIndent()
 {
     IndentLengths.Clear();
     _currentIndent = "";
     return((T)this);
 }