Exemplo n.º 1
0
        private static BorderProperties FillBorderProperties(IExcelGenerator excel, BorderProperties currBorder, BorderProperties border, ExcelBorderPart part, object style, object width, object color)
        {
            BorderProperties borderProperties = currBorder;

            if (style != null)
            {
                if (borderProperties == null)
                {
                    borderProperties = new BorderProperties(border, part);
                }
                borderProperties.Style = LayoutConvert.ToBorderLineStyle((RPLFormat.BorderStyles)style);
            }
            if (width != null)
            {
                if (borderProperties == null)
                {
                    borderProperties = new BorderProperties(border, part);
                }
                borderProperties.Width = LayoutConvert.ToPoints((string)width);
            }
            if (color != null && !color.Equals("Transparent"))
            {
                if (borderProperties == null)
                {
                    borderProperties = new BorderProperties(border, part);
                }
                borderProperties.Color = excel.AddColor((string)color);
            }
            return(borderProperties);
        }
Exemplo n.º 2
0
 private void FillBorderProperties(IExcelGenerator excel, BorderProperties border, object style, object width, object color)
 {
     if (style != null)
     {
         border.Style = LayoutConvert.ToBorderLineStyle((RPLFormat.BorderStyles)style);
     }
     if (width != null)
     {
         border.Width = LayoutConvert.ToPoints((string)width);
     }
     if (color != null && !color.Equals("Transparent"))
     {
         border.Color = excel.AddColor((string)color);
     }
 }