PoorMansTSQLFormatter by Taok

<PackageReference Include="PoorMansTSQLFormatter" Version="1.4.3.1" />

 TokenList

using PoorMansTSqlFormatterLib.Interfaces; using System.Collections; using System.Collections.Generic; using System.Text; namespace PoorMansTSqlFormatterLib { public class TokenList : List<IToken>, ITokenList, IList<IToken>, ICollection<IToken>, IEnumerable<IToken>, IEnumerable { public bool HasErrors { get; set; } public string PrettyPrint() { StringBuilder stringBuilder = new StringBuilder(); using (Enumerator enumerator = GetEnumerator()) { while (enumerator.MoveNext()) { IToken current = enumerator.Current; string text = current.Type.ToString(); stringBuilder.Append(text.PadRight(20)); stringBuilder.Append(": "); stringBuilder.AppendLine(current.Value); } } return stringBuilder.ToString(); } public new IList<IToken> GetRange(int index, int count) { return base.GetRange(index, count); } public IList<IToken> GetRangeByIndex(int fromIndex, int toIndex) { return GetRange(fromIndex, toIndex - fromIndex + 1); } } }