private void WriteValueWithPadding( IColoredTextWriter textWriter, MessageTemplate.ArgumentToken arg, string formatedValue, Color?textForegroud, Color?textBackground, Color?valueForeground, Color?valueBackground) { if (arg.Alignment > 0) { int padLeft = arg.Alignment - formatedValue.Length; textWriter.Write(textForegroud, textBackground, ' ', padLeft); } textWriter.Write( valueForeground ?? textForegroud, valueBackground ?? textBackground, formatedValue); if (arg.Alignment < 0) { int padRight = -arg.Alignment - formatedValue.Length; textWriter.Write(textForegroud, textBackground, ' ', padRight); } }
private void WriteValueWithPadding( ITextWriter textWriter, MessageTemplate.ArgumentToken arg, string formatedValue) { if (arg.Alignment > 0) { int padLeft = arg.Alignment - formatedValue.Length; textWriter.Write(' ', padLeft); } textWriter.Write(formatedValue); if (arg.Alignment < 0) { int padRight = -arg.Alignment - formatedValue.Length; textWriter.Write(' ', padRight); } }