예제 #1
0
 public static void setExcelCellBorder(MultipleBorders borders, params ExcelCell[] cells)
 {
     foreach (ExcelCell cell in cells)
     {
         cell.Style.Borders.SetBorders(borders, Color.Black, LineStyle.Medium);
     }
 }
예제 #2
0
 ///<summary>
 ///Sets specific line color and line style on multiple borders.
 ///</summary>
 ///<param name="multipleBorders">Borders to set.</param>
 ///<param name="lineColor">Border line color.</param>
 ///<param name="lineStyle">Border line style.</param>
 public void SetBorders(MultipleBorders multipleBorders, Color lineColor, LineStyle lineStyle)
 {
     for (int num1 = 0; num1 < 6; num1++)
     {
         IndividualBorder border1 = (IndividualBorder)num1;
         if ((multipleBorders & CellBorder.MultipleFromIndividualBorder(border1)) != MultipleBorders.None)
         {
             this[border1].SetBorder(lineColor, lineStyle);
         }
     }
 }
예제 #3
0
파일: CellBorders.cs 프로젝트: ikvm/test
 public void SetBorders(MultipleBorders multipleBorders, Color lineColor, LineStyle lineStyle)
 {
     for (int i = 0; i < 6; i++)
     {
         IndividualBorder individualBorder = (IndividualBorder)i;
         if ((multipleBorders & CellBorder.MultipleFromIndividualBorder(individualBorder)) != MultipleBorders.None)
         {
             this[individualBorder].SetBorder(lineColor, lineStyle);
         }
     }
 }
예제 #4
0
        public static CellStyle SetBorders(this CellStyle style, MultipleBorders borders, LineStyle lineStyle,
                                           SpreadsheetColor borderColor = default(SpreadsheetColor))
        {
            if (borderColor.IsEmpty)
            {
                borderColor = SpreadsheetColor.FromName(ColorName.Black);
            }

            style.Borders.SetBorders(borders, borderColor, lineStyle);
            return(style);
        }
예제 #5
0
파일: CellStyleData.cs 프로젝트: ikvm/test
 public CellStyleData(CellStyleCachedCollection parentCollection, bool isDefault)
     : base(parentCollection, isDefault)
 {
     this.HorizontalAlignment    = HorizontalAlignmentStyle.General;
     this.VerticalAlignment      = VerticalAlignmentStyle.Bottom;
     this.PatternStyle           = FillPatternStyle.None;
     this.PatternBackgroundColor = Color.White;
     this.PatternForegroundColor = Color.Black;
     this.Locked       = true;
     this.NumberFormat = string.Empty;
     this.FontData     = new ExcelFontData();
     this.BorderColor  = new Color[] { Color.Black, Color.Black, Color.Black, Color.Black, Color.Black };
     this.BorderStyle  = new LineStyle[5];
     this.BordersUsed  = MultipleBorders.None;
 }
예제 #6
0
        public override void SetBorders(MultipleBorders multipleBorders, Color lineColor, LineStyle lineStyle)
        {
            MergedCellRange mergedRange = this.MergedRange;

            if (mergedRange != null)
            {
                mergedRange.SetBorders(multipleBorders, lineColor, lineStyle);
            }
            else
            {
                for (int i = this.firstRow; i <= this.lastRow; i++)
                {
                    for (int j = this.firstColumn; j <= this.lastColumn; j++)
                    {
                        MultipleBorders borders = multipleBorders;
                        if (i < this.lastRow)
                        {
                            borders &= ~MultipleBorders.Bottom;
                        }
                        if (i > this.firstRow)
                        {
                            borders &= ~MultipleBorders.Top;
                        }
                        if (j < this.lastColumn)
                        {
                            borders &= ~MultipleBorders.Right;
                        }
                        if (j > this.firstColumn)
                        {
                            borders &= ~MultipleBorders.Left;
                        }
                        base.Parent.Rows[i].AllocatedCells[j].SetBorders(borders, lineColor, lineStyle);
                    }
                }
            }
        }
예제 #7
0
 ///<summary>
 ///Sets borders on one or more excel cells, taking cell position into account.
 ///</summary>
 ///<param name="multipleBorders">Borders to set.</param>
 ///<param name="lineColor">Line color.</param>
 ///<param name="lineStyle">Line style.</param>
 public abstract void SetBorders(MultipleBorders multipleBorders, Color lineColor, LineStyle lineStyle);
예제 #8
0
 public override void SetBorders(MultipleBorders multipleBorders, Color lineColor, LineStyle lineStyle)
 {
     this.Style.Borders.SetBorders(multipleBorders, lineColor, lineStyle);
 }
예제 #9
0
 public static AbstractRange SetBorders(this AbstractRange range, MultipleBorders borders, LineStyle lineStyle,
                                        SpreadsheetColor borderColor = default(SpreadsheetColor))
 {
     range.Style.SetBorders(borders, lineStyle, borderColor);
     return(range);
 }