Exemplo n.º 1
0
        /// <summary>
        /// 获取完成头
        /// </summary>
        /// <returns></returns>
        public string GetHeader()
        {
            // 创建顶部和底部分隔线
            string top_DownDividerdivider = FinalColumnWides.GetTopAndDwon(FormatInfo.AngleStr, ColumnBlankNum);
            // 创建分隔线
            string divider = FinalColumnWides.GetDivider(FormatInfo.AngleStr, ColumnBlankNum);
            // 获取标题字符串
            string tilte = FinalColumnWides.GetTitleStr(TitleString, ColumnBlankNum, FormatInfo.DelimiterStr);
            // 得到头部字符串
            string headers = ColumnShowFormats.FillFormatTostring(Columns.ToArray(), FormatInfo.DelimiterStr, ColumnBlankNum);

            //绘制表格头
            StringBuilder top = new();

            if (FormatInfo.IsShowTop_Down_DataBorder)
            {
                top.AppendLine(top_DownDividerdivider);
            }
            if (!string.IsNullOrWhiteSpace(tilte))
            {
                top.AppendLine(tilte);
                top.AppendLine(divider);
            }
            top.AppendLine(headers);
            top.AppendLine(divider);
            return(top.ToString().Trim());
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获取底
        /// </summary>
        /// <returns></returns>
        public string GetEnd()
        {
            StringBuilder down = new();

            if (FormatInfo.IsShowTop_Down_DataBorder)
            {
                down.AppendLine(FinalColumnWides.GetTopAndDwon(FormatInfo.AngleStr, ColumnBlankNum));
            }
            if (EnableCount)
            {
                down.AppendLine($" Count: {Rows.Count}");
            }
            return(down.ToString().Trim());
        }