Example #1
0
        public static DocumentContext AddCellStyle(this DocumentContext documentContext, CellStyle cellStyle, string name)
        {
            Stylesheet stylesheet = documentContext.GetStylesheet();

            if (stylesheet.CellStyles == null)
            {
                stylesheet.CellStyles = new CellStyles();
            }

            cellStyle.SetAttachedName(name);

            stylesheet.CellStyles.AppendChild(cellStyle);
            stylesheet.CellStyles.Count = (uint)stylesheet.CellStyles.ChildElements.Count;

            return(documentContext);
        }