示例#1
0
 public BaseCell(string value, int columnWidth = 0, LayoutStyle style = null)
 {
     Value       = value;
     LayoutStyle = style;
     if (columnWidth > 0)
     {
         LayoutSet = new LayoutSet {
             ColumnWidth = columnWidth
         }
     }
     ;
 }
示例#2
0
        public void AddCell(params BaseCell[] cells)
        {
            if (_childrens == null)
            {
                _childrens = new List <BaseCell>();
            }
            _childrens.AddRange(cells);
            if (LayoutSet == null)
            {
                LayoutSet = new LayoutSet {
                    RowSpan = 1, ColumnSpan = 1
                }
            }
            ;

            //check column count
            foreach (var cell in cells)
            {
                if (cell.LayoutSet == null)
                {
                    continue;
                }
                if (cell.LayoutSet.HorizontalStretch)
                {
                    LayoutSet.HorizontalStretch = true;
                }
                if (cell.LayoutSet.ColumnSpan > LayoutSet.ColumnSpan)
                {
                    LayoutSet.ColumnSpan = cell.LayoutSet.ColumnSpan;
                }
            }
            //check row count
            LayoutSet.RowSpan = _childrens.Sum(x => x.ColumnSpanOrDefault) / LayoutSet.ColumnSpan;
        }

        #endregion
    }
示例#3
0
 public BaseCell(string value, LayoutSet layoutSet = null, LayoutStyle style = null)
 {
     Value       = value;
     LayoutStyle = style;
     LayoutSet   = layoutSet;
 }