Пример #1
0
 public ColorTextBuilder AppendIf(bool condition, string text, Color?foregroundColor = null, Color?backgroundColor = null)
 {
     if (condition)
     {
         TextFragments.Add(new ColoredTextFragment(text, foregroundColor, backgroundColor));
     }
     return(this);
 }
Пример #2
0
        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);
        }
Пример #3
0
 public ColorTextBuilder Append(Func <int, string> action, Color?foregroundColor = null, Color?backgroundColor = null)
 {
     TextFragments.Add(new ColoredTextFragment(action.Invoke(Length), foregroundColor, backgroundColor));
     return(this);
 }
Пример #4
0
 public ColorTextBuilder AppendLine()
 {
     TextFragments.Add(new ColoredTextFragment(Environment.NewLine));
     return(this);
 }
Пример #5
0
 public ColorTextBuilder AppendLine(string text, Color?foregroundColor = null, Color?backgroundColor = null)
 {
     TextFragments.Add(new ColoredTextFragment(text + Environment.NewLine, foregroundColor, backgroundColor));
     return(this);
 }
Пример #6
0
 public ColorTextBuilder AppendLine(ColorTextBuilder builder)
 {
     TextFragments.AddRange(builder.TextFragments);
     TextFragments.Add(new ColoredTextFragment(Environment.NewLine));
     return(this);
 }