public ColorTextBuilder AppendIf(bool condition, string text, Color?foregroundColor = null, Color?backgroundColor = null) { if (condition) { TextFragments.Add(new ColoredTextFragment(text, foregroundColor, backgroundColor)); } return(this); }
private TextFragments FormatIndex(string lineBreak) { var frags = new TextFragments(); if (DbIndex.IsUnique) { frags.AddPrimary("UNIQUE "); } frags.AddPrimary(DbIndex.Type + " INDEX "); frags.AddPrimary("[" + DbIndex.Name + "]"); frags.AddSecondary(" ON "); frags.AddPrimary("[" + DbIndex.Parent.SchemaName + "].[" + DbIndex.Parent.Name + "]"); frags.Add(FormatColumns(lineBreak)); return(frags); }
public ColorTextBuilder Append(Func <int, string> action, Color?foregroundColor = null, Color?backgroundColor = null) { TextFragments.Add(new ColoredTextFragment(action.Invoke(Length), foregroundColor, backgroundColor)); return(this); }
public ColorTextBuilder AppendLine() { TextFragments.Add(new ColoredTextFragment(Environment.NewLine)); return(this); }
public ColorTextBuilder AppendLine(string text, Color?foregroundColor = null, Color?backgroundColor = null) { TextFragments.Add(new ColoredTextFragment(text + Environment.NewLine, foregroundColor, backgroundColor)); return(this); }
public ColorTextBuilder AppendLine(ColorTextBuilder builder) { TextFragments.AddRange(builder.TextFragments); TextFragments.Add(new ColoredTextFragment(Environment.NewLine)); return(this); }