Example #1
0
    void Start()
    {
        loadUI();

        rowOptions = new Dictionary <RowColor, Transform>();
        loadRowOptions();

        rowColour   = RowColor.Blue;
        currentList = new List <RowInfoInitializer>();
    }
Example #2
0
        /// <summary>
        /// Excel处理
        /// </summary>
        /// <param name="excelGlobalDTO"></param>
        public void ExcelHandle(ExcelGlobalDTO <TEntity> excelGlobalDTO)
        {
            //执行处理前扩展
            ExcelHandleBefore(excelGlobalDTO);

            //设置区块
            AreaBlock <TEntity> areaBlock = new AreaBlock <TEntity>();

            areaBlock.SetAreaBlock(excelGlobalDTO);

            //设置头部颜色
            HeadColor <TEntity> headColor = new HeadColor <TEntity>();

            headColor.SetHeadColor(excelGlobalDTO);

            excelGlobalDTO.PerformanceMonitoring.Start("SetRowColor");
            //设置行颜色
            RowColor <TEntity> rowColor = new RowColor <TEntity>();

            rowColor.SetRowColor(excelGlobalDTO);
            excelGlobalDTO.PerformanceMonitoring.Stop();

            //设置锁定
            SheetLocked <TEntity> sheetLocked = new SheetLocked <TEntity>();

            sheetLocked.SetSheetLocked(excelGlobalDTO);

            //设置列隐藏
            SheetColumnHidden <TEntity> sheetColumnHidden = new SheetColumnHidden <TEntity>();

            sheetColumnHidden.SetSheetColumnHidden(excelGlobalDTO);

            //批注
            Comment <TEntity> comment = new Comment <TEntity>();

            //清空批注
            comment.ClearComment(excelGlobalDTO);

            //设置批注
            comment.SetComment(excelGlobalDTO);

            //设置列类型
            SheetColumnType <TEntity> sheetColumnType = new SheetColumnType <TEntity>();

            sheetColumnType.SetSheetColumnType(excelGlobalDTO);

            //从Excel处理
            SlaveExcel <TEntity> slaveExcel = new SlaveExcel <TEntity>();

            slaveExcel.SlaveExcelHandle(excelGlobalDTO);

            //执行处理后扩展
            ExcelHandleAfter(excelGlobalDTO);
        }
 public TableRow Style(RowColor style)
 {
     switch (style)
     {
         case RowColor.Info:
             EnsureClass("info");
             break;
         case RowColor.Error:
             EnsureClass("error");
             break;
         case RowColor.Success:
             EnsureClass("success");
             break;
         case RowColor.Warning:
             EnsureClass("warning");
             break;
     }
     return this;
 }
Example #4
0
        public TableRow Style(RowColor style)
        {
            switch (style)
            {
            case RowColor.Info:
                EnsureClass("info");
                break;

            case RowColor.Error:
                EnsureClass("error");
                break;

            case RowColor.Success:
                EnsureClass("success");
                break;

            case RowColor.Warning:
                EnsureClass("warning");
                break;
            }
            return(this);
        }
        public TableRowBuilder <TModel> BeginRow(RowColor style, object htmlAttributes)
        {
            var tr = new TableRow().Style(style).HtmlAttributes(htmlAttributes);

            return(new TableRowBuilder <TModel>(base.htmlHelper, tr));
        }
        public TableRowBuilder <TModel> BeginRow(RowColor style)
        {
            var tr = new TableRow().Style(style);

            return(new TableRowBuilder <TModel>(base.htmlHelper, tr));
        }
Example #7
0
 public void InsertRow(int numrows = 1)
 {
     if (numrows < 0)
     {
         throw new Exception("Invalid number of rows to be generated");
     }
     else if (ColumnFormat.Split(';').Count() != Columns && !string.IsNullOrEmpty(ColumnFormat))
     {
         throw new Exception("Invalid ColumnFormat for the number of Columns");
     }
     else
     {
         for (int i = 0; i < numrows; i++)
         {
             int      rowindex = Rows.Count - 1;
             TableRow row      = new TableRow();
             for (int j = 0; j < Columns; j++)
             {
                 row.Cells.Add(GenerateCell(rowindex, j));
             }
             row.Style.Add(HtmlTextWriterStyle.BackgroundColor, (rowindex % 2 == 0 ? RowColor.ToString() : RowAlternatingColor.ToString()));
             Rows.Add(row);
         }
         CurrentRows = Rows.Count - 1;
         DataBind();
     }
 }
Example #8
0
 public void setColor(RowColor color)
 {
     rowColour = color;
 }