Пример #1
0
		/// <summary>
		/// Creates the field format based on the field name, format string, padding direction, total width and padding char.
		/// </summary>
		/// <param name="name">The name of the field.</param>
		/// <param name="format">The format string.</param>
		/// <param name="paddingDir">The padding direction.</param>
		/// <param name="totalWidth">The total width.</param>
		/// <param name="paddingChar">The padding char.</param>
		public FieldFormat(string name, string format, PaddingDirection paddingDir, int totalWidth, char paddingChar)
		{
			this.Name = name;
			this.Format = format;
			this.PaddingDir = paddingDir;
			this.TotalWidth = totalWidth;
			this.PaddingChar = paddingChar;
		}
Пример #2
0
 /// <summary>
 /// Creates the field format based on the field name, format string, padding direction, total width and padding char.
 /// </summary>
 /// <param name="name">The name of the field.</param>
 /// <param name="format">The format string.</param>
 /// <param name="paddingDir">The padding direction.</param>
 /// <param name="totalWidth">The total width.</param>
 /// <param name="paddingChar">The padding char.</param>
 public FieldFormat(string name, string format, PaddingDirection paddingDir, int totalWidth, char paddingChar)
 {
     Name        = name;
     Format      = format;
     PaddingDir  = paddingDir;
     TotalWidth  = totalWidth;
     PaddingChar = paddingChar;
 }
Пример #3
0
 /// <summary>
 /// Creates the field format based on the field name, format string, padding direction, total width and padding char.
 /// </summary>
 /// <param name="name">The name of the field.</param>
 /// <param name="format">The format string.</param>
 /// <param name="paddingDir">The padding direction.</param>
 /// <param name="totalWidth">The total width.</param>
 /// <param name="paddingChar">The padding char.</param>
 public FieldFormat(string name, string format, PaddingDirection paddingDir, int totalWidth, char paddingChar)
 {
     this.Name        = name;
     this.Format      = format;
     this.PaddingDir  = paddingDir;
     this.TotalWidth  = totalWidth;
     this.PaddingChar = paddingChar;
 }
 /// <summary>
 /// Add an FieldFormat object based the field name, format string, padding direction, total width and padding char.
 /// </summary>
 /// <param name="name">The name of the field.</param>
 /// <param name="format">The format string of the field.</param>
 /// <param name="paddingDir">The padding direction.</param>
 /// <param name="totalWidth">The total width.</param>
 /// <param name="paddingChar">The padding char.</param>
 public void Add(string name, string format, PaddingDirection paddingDir, int totalWidth, char paddingChar)
 {
     List.Add(new FieldFormat(name, format, paddingDir, totalWidth, paddingChar));
 }
Пример #5
0
 /// <summary>
 /// Add an FieldFormat object based the field name, format string, padding direction, total width and padding char.
 /// </summary>
 /// <param name="name">The name of the field.</param>
 /// <param name="format">The format string of the field.</param>
 /// <param name="paddingDir">The padding direction.</param>
 /// <param name="totalWidth">The total width.</param>
 /// <param name="paddingChar">The padding char.</param>
 public void Add(string name, string format, PaddingDirection paddingDir, int totalWidth, char paddingChar)
 {
     List.Add(new FieldFormat(name, format, paddingDir, totalWidth, paddingChar));
 }
Пример #6
0
 private string ApplyPadding(string paddedValue, PaddingDirection direction, char character, int width)
 {
     return(direction == PaddingDirection.Left
         ? paddedValue.PadLeft(width, character)
         : paddedValue.PadRight(width, character));
 }