예제 #1
0
파일: PrintList.cs 프로젝트: silky/KOS
 public kListColumn(string title, int width, ColumnAlignment alignment, string format)
 {
     this.Title     = title;
     this.Width     = width;
     this.Alignment = alignment;
     this.Format    = format;
 }
예제 #2
0
        public DocumentColumn(PropertyInfo propertyInfo, string header, Func <object> getDefaultValueFunc, int columnWidth, ColumnAlignment alignment, string stringFormat, IFormatProvider provider, string booleanTrue, string booleanFalse, Func <string, object> importFunc, Func <T, object, string> exportFunc, char fillChar, bool throwOnColumnOverflow, bool exportQuotedString)
        {
            _propertyInfo          = propertyInfo;
            Header                 = header;
            _getDefaultValueFunc   = getDefaultValueFunc;
            _stringFormat          = stringFormat;
            _provider              = provider;
            ColumnWidth            = columnWidth;
            Alignment              = alignment;
            _booleanTrue           = booleanTrue;
            _booleanFalse          = booleanFalse;
            _importFunc            = importFunc;
            _exportFunc            = exportFunc;
            _fillChar              = fillChar;
            _throwOnColumnOverflow = throwOnColumnOverflow;
            _exportQuotedString    = exportQuotedString;

            if (_propertyInfo != null)
            {
                _getValueFunc = _propertyInfo.GetValueGetter <T>();
                Header        = Header ?? _propertyInfo.Name;
                _type         = _propertyInfo.PropertyType;
            }
            else
            {
                _isDummyColumn = true;
                _getValueFunc  = x => "";
                Header         = Header ?? "";
            }
        }
        public ScriptColumn(string label,
                            ScriptBlock script,
                            ColumnAlignment alignment,
                            int width,
                            string tag,
                            TrimLocation trimLocation,
                            bool captureContext)
            : base(alignment, width, tag, trimLocation)
        {
            if (String.IsNullOrEmpty(label))
            {
                throw new ArgumentException("You must supply a column label.", "label");
            }

            if (null == script)
            {
                throw new ArgumentNullException("script");
            }

            m_label = label;
            Script  = script;
            if (captureContext)
            {
                Context = DbgProvider.CapturePsContext();
            }
        } // end constructor
예제 #4
0
파일: PrintList.cs 프로젝트: pgodd/KOS
 public kListColumn(string title, int width, ColumnAlignment alignment, string format)
 {
     Title     = title;
     Width     = width;
     Alignment = alignment;
     Format    = format;
 }
 public PropertyColumn(string propertyName,
                       ColorString formatString,
                       ColumnAlignment alignment,
                       int width)
     : this(propertyName, formatString, null, alignment, width)
 {
 }
 public ScriptColumn(string label,
                     ScriptBlock script,
                     ColumnAlignment alignment,
                     int width)
     : this(label, script, alignment, width, null)
 {
 }
예제 #7
0
        public ColumnDetail(string name, float width, ColumnAlignment alignment = ColumnAlignment.Left, ColumnType columnType = ColumnType.TextBox)
        {
            ColumnName   = name;
            ColumnWidth  = width;
            TypeofColumn = columnType;
#if __PC__
            switch (alignment)
            {
            case ColumnAlignment.Left: Alignment = DataGridViewContentAlignment.MiddleLeft; break;

            case ColumnAlignment.Right: Alignment = DataGridViewContentAlignment.MiddleRight; break;

            case ColumnAlignment.Center: Alignment = DataGridViewContentAlignment.MiddleCenter; break;
            }
#elif __MACOS__
            switch (alignment)
            {
            case ColumnAlignment.Left: Alignment = NSTextAlignment.Left; break;

            case ColumnAlignment.Right: Alignment = NSTextAlignment.Right; break;

            case ColumnAlignment.Center: Alignment = NSTextAlignment.Center; break;
            }
#endif
        }
 public ScriptColumn(string label,
                     ScriptBlock script,
                     ColumnAlignment alignment,
                     int width,
                     string tag)
     : this(label, script, alignment, width, tag, TrimLocation.Right)
 {
 }
예제 #9
0
 public ColumnDesign(string label, ColumnAlignment alignment, int autoWrap)
 {
     this.label = label;
     this.alignment = alignment;
     initialWidth = label.Length;
     width = initialWidth;
     display = true;
     autoWrapCol = autoWrap;
 }
 public PropertyColumn(string propertyName,
                       ColorString formatString,
                       string label,
                       ColumnAlignment alignment,
                       int width,
                       string tag)
     : this(propertyName, formatString, label, alignment, width, tag, TrimLocation.Right)
 {
 }
예제 #11
0
 public ColumnDesign(string label, ColumnAlignment alignment, int autoWrap)
 {
     this.label     = label;
     this.alignment = alignment;
     initialWidth   = label.Length;
     width          = initialWidth;
     display        = true;
     autoWrapCol    = autoWrap;
 }
예제 #12
0
        /// <summary>
        /// Returns a Rectangle that specifies the size and location of the Color
        /// rectangle
        /// </summary>
        /// <param name="rowAlignment">The alignment of the Cells Row</param>
        /// <param name="columnAlignment">The alignment of the Cells Column</param>
        /// <returns>A Rectangle that specifies the size and location of the Color
        /// rectangle</returns>
        protected Rectangle CalcColorRect(RowAlignment rowAlignment, ColumnAlignment columnAlignment)
        {
            Rectangle rect = this.ClientRectangle;

            rect.X      += 2;
            rect.Y      += 2;
            rect.Height -= 6;
            rect.Width   = 16;

            return(rect);
        }
예제 #13
0
        public ColumnInfo(string header, ColumnAlignment alignment = ColumnAlignment.Left)
        {
            if (string.IsNullOrWhiteSpace(header))
            {
                throw new ArgumentException("Value cannot be null or whitespace.", nameof(header));
            }

            this.Header        = header;
            this.Alignment     = alignment;
            this.CurrentLength = header.Length;
        }
예제 #14
0
		/// <summary>
		/// Returns a Rectangle that specifies the size and location of the Color 
		/// rectangle
		/// </summary>
		/// <param name="rowAlignment">The alignment of the Cells Row</param>
		/// <param name="columnAlignment">The alignment of the Cells Column</param>
		/// <returns>A Rectangle that specifies the size and location of the Color 
		/// rectangle</returns>
		protected Rectangle CalcColorRect(RowAlignment rowAlignment, ColumnAlignment columnAlignment)
		{
			Rectangle rect = this.ClientRectangle;

			rect.X += 2;
			rect.Y += 2;
			rect.Height -= 6;
			rect.Width = 16;

			return rect;
		}
예제 #15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TableColumn"/> class.
 /// </summary>
 public TableColumn(
     string property,
     MethodInfo method         = null,
     ColumnAlignment alignment = ColumnAlignment.Left,
     int width    = 0,
     string label = null)
 {
     Property  = property;
     Method    = method;
     Alignment = alignment;
     Width     = width;
     Label     = label;
 }
예제 #16
0
        protected string FormatString(string text, char fillchar, int len, ColumnAlignment alignment)
        {
            // Console.Out.WriteLine("[formatString] len: " + len + ", text.Length: " + text.Length);
            // text = "hi";
            StringBuilder fillstr = new StringBuilder();

            if (len > 4000)
            {
                len = 4000;
            }

            if (text == null)
            {
                text = ColumnValue.NullText;
            }

            int slen = text.Length;

            if (alignment == ColumnAlignment.Left)
            {
                fillstr.Append(text);
            }

            int fillNumber = len - slen;
            int boundary   = 0;

            if (alignment == ColumnAlignment.Center)
            {
                boundary = fillNumber / 2;
            }

            while (fillNumber > boundary)
            {
                fillstr.Append(fillchar);
                --fillNumber;
            }

            if (alignment != ColumnAlignment.Left)
            {
                fillstr.Append(text);
            }

            while (fillNumber > 0)
            {
                fillstr.Append(fillchar);
                --fillNumber;
            }

            return(fillstr.ToString());
        }
        public Footer(ColumnAlignment alignment, ScriptBlock script, bool captureContext)
        {
            if (null == script)
            {
                throw new ArgumentNullException("script");
            }

            Alignment = alignment;
            Script    = script;
            if (captureContext)
            {
                Context = DbgProvider.CapturePsContext();
            }
        }
예제 #18
0
 /// <summary>
 /// Defines the style details for the column
 /// </summary>
 /// <param name="title">The title</param>
 /// <param name="alignment">The text alignment</param>
 /// <param name="importance">The importance</param>
 /// <param name="noWrap">True, if the cell text shouldn't word wrap</param>
 public virtual void DefineStyle
 (
     string title,
     ColumnAlignment alignment,
     DataImportance importance = default,
     bool noWrap = false
 )
 {
     this.Title      = title;
     this.Alignment  = alignment;
     this.Importance = importance;
     this.NoWrap     = noWrap;
     this.HasStyling = true;
 }
예제 #19
0
파일: PrintList.cs 프로젝트: pgodd/KOS
            public void AddColumn(string title, int width, ColumnAlignment alignment, string format)
            {
                columns.Add(new kListColumn(title, width, alignment, format));
                formatString = string.Empty;
                totalWidth  += width;

                if (alignment == ColumnAlignment.Left)
                {
                    headerString += title.Substring(0, Math.Min(width, title.Length)).PadRight(width);
                }
                else
                {
                    headerString += title.Substring(0, Math.Min(width, title.Length)).PadLeft(width);
                }
            }
예제 #20
0
 public TableStyle(char top         = '-',
                   char right       = '|',
                   char bottom      = '-',
                   char left        = '|',
                   string separator = " | ",
                   bool titleBorder = false,
                   ColumnAlignment titleAlignment = ColumnAlignment.Left)
 {
     Top            = top;
     Right          = right;
     Bottom         = bottom;
     Left           = left;
     Separator      = separator;
     TitleBorder    = titleBorder;
     TitleAlignment = titleAlignment;
 }
        public ScriptColumn(string label,
                            ScriptBlock script,
                            ColumnAlignment alignment,
                            int width,
                            string tag,
                            TrimLocation trimLocation)
            : base(alignment, width, tag, trimLocation)
        {
            if (String.IsNullOrEmpty(label))
            {
                throw new ArgumentException("You must supply a column label.", nameof(label));
            }

            Label  = label;
            Script = script ?? throw new ArgumentNullException(nameof(script));
        } // end constructor
예제 #22
0
        public ColumnInfo(string header, ColumnAlignment alignment = ColumnAlignment.Left, int fixedLength = 0)
        {
            if (string.IsNullOrWhiteSpace(header))
            {
                throw new ArgumentException("Value cannot be null or whitespace.", nameof(header));
            }
            if (header.ToCharArray().Any(ch => ch.IsSystemChar()))
            {
                throw new ArgumentException("Header name cannot contain special characters.", nameof(header));
            }

            this.Header        = header;
            this.Alignment     = alignment;
            this.CurrentLength = header.Length;
            this.FixedLength   = fixedLength;
        }
예제 #23
0
        private static XLAlignmentHorizontalValues MapAlignment(ColumnAlignment alignment)
        {
            switch (alignment)
            {
            case ColumnAlignment.Center:
                return(XLAlignmentHorizontalValues.Center);

            case ColumnAlignment.Left:
                return(XLAlignmentHorizontalValues.Left);

            case ColumnAlignment.Right:
                return(XLAlignmentHorizontalValues.Right);

            default:
                return(XLAlignmentHorizontalValues.Left);
            }
        }
예제 #24
0
        private static string ColumnAlignToString(this ColumnAlignment ca)
        {
            switch (ca)
            {
            case ColumnAlignment.Left:
                return("left");

            case ColumnAlignment.Right:
                return("right");

            case ColumnAlignment.Center:
                return("center");

            default:
                return("left");
            }
        }
예제 #25
0
        private static ParagraphAlignment MapAlignment(ColumnAlignment alignment)
        {
            switch (alignment)
            {
            case ColumnAlignment.Center:
                return(ParagraphAlignment.Center);

            case ColumnAlignment.Left:
                return(ParagraphAlignment.Left);

            case ColumnAlignment.Right:
                return(ParagraphAlignment.Right);

            default:
                return(ParagraphAlignment.Left);
            }
        }
예제 #26
0
        public GridColumn(string title,
                          Func <T, string> source, ColumnWidth minWidth,
                          ColumnWidth maxWidth          = null,
                          ColumnAlignment alignment     = ColumnAlignment.Left,
                          Func <T, string> dynamicStyle = null)
        {
            Title        = title;
            Source       = source;
            MinWidth     = minWidth;
            DynamicStyle = dynamicStyle;

            if (maxWidth != null)
            {
                MaxWidth = maxWidth;
            }

            Alignment = alignment;
        }
        public PropertyColumn(string propertyName,
                              ColorString formatString,
                              string label,
                              ColumnAlignment alignment,
                              int width,
                              string tag,
                              TrimLocation trimLocation)
            : base(alignment, width, tag, trimLocation)
        {
            if (String.IsNullOrEmpty(propertyName))
            {
                throw new ArgumentException("You must supply a property name.", "propertyname");
            }

            PropertyName = propertyName;
            FormatString = formatString;
            m_label      = label;
        } // end constructor
예제 #28
0
        /// <summary>
        /// Initialise default values
        /// </summary>
        private void Init()
        {
            this.text         = null;
            this.width        = Column.DefaultWidth;
            this.columnState  = ColumnState.Normal;
            this.alignment    = ColumnAlignment.Left;
            this.image        = null;
            this.imageOnRight = false;
            this.columnModel  = null;
            this.x            = 0;
            this.tooltipText  = null;
            this.format       = "";
            this.sortOrder    = SortOrder.None;
            this.renderer     = null;
            this.editor       = null;
            this.comparer     = null;

            this.state = (byte)(STATE_ENABLED | STATE_EDITABLE | STATE_VISIBLE | STATE_SELECTABLE | STATE_SORTABLE);
        }
예제 #29
0
        /// <summary>
        /// Applies style configuration to a table column definition
        /// </summary>
        /// <param name="columnName">The column name</param>
        /// <param name="title">The title</param>
        /// <param name="alignment">The text alignment</param>
        /// <param name="importance">The importance</param>
        /// <param name="noWrap">True, if the cell text shouldn't word wrap</param>
        public void StyleColumn
        (
            string columnName,
            string title,
            ColumnAlignment alignment,
            DataImportance importance = default,
            bool noWrap = false
        )
        {
            var column = GetColumn(columnName);

            column.DefineStyle
            (
                title,
                alignment,
                importance,
                noWrap
            );
        }
예제 #30
0
        /// <summary>
        /// Constructs the table column with the details
        /// </summary>
        /// <param name="name">The column name</param>
        /// <param name="title">The title</param>
        /// <param name="alignment">The alignment (optional)</param>
        /// <param name="importance">The importance (optional)</param>
        /// <param name="noWrap">Should text be wrapped (optional)</param>
        public TableColumn
        (
            string name,
            string title,
            ColumnAlignment alignment = default,
            DataImportance importance = default,
            bool noWrap = false
        )
        {
            Validate.IsNotEmpty(name);
            Validate.IsNotEmpty(title);

            this.ColumnId   = Guid.NewGuid();
            this.Name       = name;
            this.Title      = title;
            this.Alignment  = alignment;
            this.Importance = importance;
            this.NoWrap     = noWrap;
        }
예제 #31
0
        /// <summary>
        /// Gets the Rectangle that specifies the Size and Location of
        /// the check box contained in the current Cell
        /// </summary>
        /// <returns>A Rectangle that specifies the Size and Location of
        /// the check box contained in the current Cell</returns>
        protected Rectangle CalcCheckRect(RowAlignment rowAlignment, ColumnAlignment columnAlignment)
        {
            Rectangle checkRect = new Rectangle(this.ClientRectangle.Location, this.CheckSize);

            if (checkRect.Height > this.ClientRectangle.Height)
            {
                checkRect.Height = this.ClientRectangle.Height;
                checkRect.Width  = checkRect.Height;
            }

            switch (rowAlignment)
            {
            case RowAlignment.Center:
            {
                checkRect.Y += (this.ClientRectangle.Height - checkRect.Height) / 2;

                break;
            }

            case RowAlignment.Bottom:
            {
                checkRect.Y = this.ClientRectangle.Bottom - checkRect.Height;

                break;
            }
            }

            if (!this.DrawText)
            {
                if (columnAlignment == ColumnAlignment.Center)
                {
                    checkRect.X += (this.ClientRectangle.Width - checkRect.Width) / 2;
                }
                else if (columnAlignment == ColumnAlignment.Right)
                {
                    checkRect.X = this.ClientRectangle.Right - checkRect.Width;
                }
            }

            return(checkRect);
        }
예제 #32
0
		/// <summary>
		/// Gets the Rectangle that specifies the Size and Location of 
		/// the check box contained in the current Cell
		/// </summary>
		/// <returns>A Rectangle that specifies the Size and Location of 
		/// the check box contained in the current Cell</returns>
		protected Rectangle CalcCheckRect(RowAlignment rowAlignment, ColumnAlignment columnAlignment)
		{
			Rectangle checkRect = new Rectangle(this.ClientRectangle.Location, this.CheckSize);
			
			if (checkRect.Height > this.ClientRectangle.Height)
			{
				checkRect.Height = this.ClientRectangle.Height;
				checkRect.Width = checkRect.Height;
			}

			switch (rowAlignment)
			{
				case RowAlignment.Center:
				{
					checkRect.Y += (this.ClientRectangle.Height - checkRect.Height) / 2;

					break;
				}

				case RowAlignment.Bottom:
				{
					checkRect.Y = this.ClientRectangle.Bottom - checkRect.Height;

					break;
				}
			}

			if (!this.DrawText)
			{
				if (columnAlignment == ColumnAlignment.Center)
				{
					checkRect.X += (this.ClientRectangle.Width - checkRect.Width) / 2;
				}
				else if (columnAlignment == ColumnAlignment.Right)
				{
					checkRect.X = this.ClientRectangle.Right - checkRect.Width;
				}
			}

			return checkRect;
		}
예제 #33
0
        /// <summary>
        /// Initialise default values
        /// </summary>
        private void Init()
        {
            this.text         = null;
            this.width        = Column.DefaultWidth;
            this.columnState  = ColumnState.Normal;
            this.alignment    = ColumnAlignment.Left;
            this.image        = null;
            this.imageOnRight = false;
            this.columnModel  = null;
            this.x            = 0;
            this.tooltipText  = null;
            this.format       = "";
            this.sortOrder    = SortOrder.None;
            this.renderer     = null;
            this.editor       = null;
            this.comparer     = null;

            // Mateusz [PEYN] Adamus ([email protected])
            // Added STATE_RESIZABLE to column's initialization
            this.state = (byte)(STATE_ENABLED | STATE_EDITABLE | STATE_VISIBLE | STATE_SELECTABLE | STATE_SORTABLE | STATE_RESIZABLE);
        }
예제 #34
0
파일: PrintList.cs 프로젝트: CalebJ2/KOS
 public kListColumn(string title, int width, ColumnAlignment alignment, string format)
 {
     Title = title;
     Width = width;
     Alignment = alignment;
     Format = format;
 }
예제 #35
0
 /// <summary>
 /// Initializes a new instance of the CellStyle class with default settings and a specific Alignment
 /// </summary>
 /// <param name="alignment"></param>
 public CellStyle(ColumnAlignment alignment)
     : this()
 {
     this.Alignment = alignment;
 }
예제 #36
0
 public kListColumn(string title, int width, ColumnAlignment alignment, string format)
 {
     this.Title = title;
     this.Width = width;
     this.Alignment = alignment;
     this.Format = format;
 }
예제 #37
0
 Rectangle CalcCheckRect(RowAlignment rowAlignment, ColumnAlignment columnAlignment)
 {
     return CalcCheckRectangle();
 }
예제 #38
0
파일: Column.cs 프로젝트: zhuangyy/Motion
        /// <summary>
        /// Initialise default values
        /// </summary>
        private void Init()
        {
            this.text = null;
            this.width = Column.DefaultWidth;
            this.columnState = ColumnState.Normal;
            this.alignment = ColumnAlignment.Left;
            this.image = null;
            this.imageOnRight = false;
            this.columnModel = null;
            this.x = 0;
            this.tooltipText = null;
            this.format = "";
            this.sortOrder = SortOrder.None;
            this.renderer = null;
            this.editor = null;
            this.comparer = null;

            // Mateusz [PEYN] Adamus ([email protected])
            // Added STATE_RESIZABLE to column's initialization
            this.state = (byte) (STATE_ENABLED | STATE_EDITABLE | STATE_VISIBLE | STATE_SELECTABLE | STATE_SORTABLE | STATE_RESIZABLE );
        }
예제 #39
0
        /// <summary>
        /// Initialise default values
        /// </summary>
        private void Init()
        {
            this.text = null;
            this.width = Column.DefaultWidth;
            this.columnState = ColumnState.Normal;
            this.alignment = ColumnAlignment.Left;
            this.image = null;
            this.imageOnRight = false;
            this.columnModel = null;
            this.x = 0;
            this.tooltipText = null;
            this.format = "";
            this.sortOrder = SortOrder.None;
            this.renderer = null;
            this.editor = null;
            this.comparer = null;

            this.state = (byte) (STATE_ENABLED | STATE_EDITABLE | STATE_VISIBLE | STATE_SELECTABLE | STATE_SORTABLE);
        }
예제 #40
0
 public ColumnDesign(string label, ColumnAlignment alignment)
     : this(label, alignment, -1)
 {
 }
예제 #41
0
파일: PrintList.cs 프로젝트: CalebJ2/KOS
            public void AddColumn(string title, int width, ColumnAlignment alignment, string format)
            {
                columns.Add(new kListColumn(title, width, alignment, format));
                formatString = string.Empty;
                totalWidth += width;

                if (alignment == ColumnAlignment.Left)
                {
                    headerString += title.Substring(0, Math.Min(width, title.Length)).PadRight(width);
                }
                else
                {
                    headerString += title.Substring(0, Math.Min(width, title.Length)).PadLeft(width);
                }
            }
예제 #42
0
		/// <summary>
		/// Gets the Rectangle that specifies the Size and Location of 
		/// the Image contained in the current Cell
		/// </summary>
		/// <param name="image">The Image to be drawn</param>
		/// <param name="sizeMode">An ImageSizeMode that specifies how the 
		/// specified Image is scaled</param>
		/// <param name="rowAlignment">The alignment of the current Cell's row</param>
		/// <param name="columnAlignment">The alignment of the current Cell's Column</param>
		/// <returns>A Rectangle that specifies the Size and Location of 
		/// the Image contained in the current Cell</returns>
		protected Rectangle CalcImageRect(Image image, ImageSizeMode sizeMode, RowAlignment rowAlignment, ColumnAlignment columnAlignment)
		{
			if (this.DrawText)
			{
				sizeMode = ImageSizeMode.ScaledToFit;
			}

			Rectangle imageRect = this.ClientRectangle;

			if (sizeMode == ImageSizeMode.Normal)
			{
				if (image.Width < imageRect.Width)
				{
					imageRect.Width = image.Width;
				}

				if (image.Height < imageRect.Height)
				{
					imageRect.Height = image.Height;
				}
			}
			else if (sizeMode == ImageSizeMode.ScaledToFit)
			{
				if (image.Width >= imageRect.Width || image.Height >= imageRect.Height)
				{
					double hScale = ((double) imageRect.Width) / ((double) image.Width);
					double vScale = ((double) imageRect.Height) / ((double) image.Height);

					double scale = Math.Min(hScale, vScale);

					imageRect.Width = (int) (((double) image.Width) * scale);
					imageRect.Height = (int) (((double) image.Height) * scale);
				}
				else
				{
					imageRect.Width = image.Width;
					imageRect.Height = image.Height;
				}
			}

			if (rowAlignment == RowAlignment.Center)
			{
				imageRect.Y += (this.ClientRectangle.Height - imageRect.Height) / 2;
			}
			else if (rowAlignment == RowAlignment.Bottom)
			{
				imageRect.Y = this.ClientRectangle.Bottom - imageRect.Height;
			}

			if (!this.DrawText)
			{
				if (columnAlignment == ColumnAlignment.Center)
				{
					imageRect.X += (this.ClientRectangle.Width - imageRect.Width) / 2;
				}
				else if (columnAlignment == ColumnAlignment.Right)
				{
					imageRect.X = this.ClientRectangle.Width - imageRect.Width;
				}
			}

			return imageRect;
		}
예제 #43
0
        protected string FormatString(string text, char fillchar, int len, ColumnAlignment alignment)
        {
            // Console.Out.WriteLine("[formatString] len: " + len + ", text.Length: " + text.Length);
            // text = "hi";
            StringBuilder fillstr = new StringBuilder();

            if (len > 4000)
                len = 4000;

            if (text == null)
                text = ColumnValue.NullText;

            int slen = text.Length;

            if (alignment == ColumnAlignment.Left)
                fillstr.Append(text);

            int fillNumber = len - slen;
            int boundary = 0;
            if (alignment == ColumnAlignment.Center)
                boundary = fillNumber / 2;

            while (fillNumber > boundary) {
                fillstr.Append(fillchar);
                --fillNumber;
            }

            if (alignment != ColumnAlignment.Left)
                fillstr.Append(text);

            while (fillNumber > 0) {
                fillstr.Append(fillchar);
                --fillNumber;
            }

            return fillstr.ToString();
        }
예제 #44
0
파일: PrintList.cs 프로젝트: CalebJ2/KOS
 public void AddColumn(string title, int width, ColumnAlignment alignment)
 {
     AddColumn(title, width, alignment, string.Empty);
 }