Ejemplo n.º 1
0
        /// <summary>
        /// Create a new <see cref="T:Dt.Xls.ExcelBorder" /> based on the current item.
        /// </summary>
        /// <returns>
        /// An <see cref="T:Dt.Xls.ExcelBorder" /> represent a cloned <see cref="T:Dt.Xls.ExcelBorder" /> instance.
        /// </returns>
        public override IExcelBorder Clone()
        {
            ExcelTableBorder border = new ExcelTableBorder();
            ExcelBorderSide  side   = new ExcelBorderSide {
                Color     = base.Left.Color,
                LineStyle = base.Left.LineStyle
            };

            border.Left = side;
            ExcelBorderSide side2 = new ExcelBorderSide {
                Color     = base.Right.Color,
                LineStyle = base.Right.LineStyle
            };

            border.Right = side2;
            ExcelBorderSide side3 = new ExcelBorderSide {
                Color     = base.Top.Color,
                LineStyle = base.Top.LineStyle
            };

            border.Top = side3;
            ExcelBorderSide side4 = new ExcelBorderSide {
                Color     = base.Bottom.Color,
                LineStyle = base.Bottom.LineStyle
            };

            border.Bottom     = side4;
            border.Vertical   = (this.Vertical != null) ? new ExcelBorderSide() : null;
            border.Horizontal = (this.Horizontal != null) ? new ExcelBorderSide() : null;
            return(border);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Create a new <see cref="T:Dt.Xls.ExcelBorder" /> based on the current item.
        /// </summary>
        /// <returns>
        /// An <see cref="T:Dt.Xls.ExcelBorder" /> represent a cloned <see cref="T:Dt.Xls.ExcelBorder" /> instance.
        /// </returns>
        public virtual IExcelBorder Clone()
        {
            ExcelBorder     border = new ExcelBorder();
            ExcelBorderSide side   = new ExcelBorderSide {
                Color     = this.Left.Color,
                LineStyle = this.Left.LineStyle
            };

            border.Left = side;
            ExcelBorderSide side2 = new ExcelBorderSide {
                Color     = this.Right.Color,
                LineStyle = this.Right.LineStyle
            };

            border.Right = side2;
            ExcelBorderSide side3 = new ExcelBorderSide {
                Color     = this.Top.Color,
                LineStyle = this.Top.LineStyle
            };

            border.Top = side3;
            ExcelBorderSide side4 = new ExcelBorderSide {
                Color     = this.Bottom.Color,
                LineStyle = this.Bottom.LineStyle
            };

            border.Bottom = side4;
            return(border);
        }