private TableCellTextStyle GetTableCellTextStyle(bool create) { TablePartStyleType tablePartStyleType = this.tablePartStyleTypeGenerator(true); TableCellTextStyle result = tablePartStyleType.TableCellTextStyle; if (result == null && create) { result = new TableCellTextStyle(); tablePartStyleType.TableCellTextStyle = result; } return(result); }
public ITablePartStyle SetFontColor(OpenXmlColor color) { TableCellTextStyle tableCellTextStyle = this.tableCellTextStyleGenerator(true); tableCellTextStyle.RemoveAllChildren <SchemeColor>(); tableCellTextStyle.RemoveAllChildren <HslColor>(); tableCellTextStyle.RemoveAllChildren <RgbColorModelHex>(); tableCellTextStyle.RemoveAllChildren <RgbColorModelPercentage>(); tableCellTextStyle.RemoveAllChildren <SystemColor>(); tableCellTextStyle.RemoveAllChildren <PresetColor>(); tableCellTextStyle.AppendChild(color.CreateColorElement()); return(this.result); }
public ITablePartStyle SetFont(OpenXmlFontRef fontRef) { TableCellTextStyle tableCellTextStyle = this.tableCellTextStyleGenerator(true); tableCellTextStyle.RemoveAllChildren <FontReference>(); tableCellTextStyle.RemoveAllChildren <Fonts>(); FontReference element = new FontReference { Index = (FontCollectionIndexValues)fontRef.Index }; if (fontRef.Color != null) { element.AppendChild(fontRef.Color.CreateColorElement()); } tableCellTextStyle.PrependChild(element); return(this.result); }
public ITablePartStyle SetFont(string typeface) { TableCellTextStyle tableCellTextStyle = this.tableCellTextStyleGenerator(true); tableCellTextStyle.RemoveAllChildren <FontReference>(); tableCellTextStyle.RemoveAllChildren <Fonts>(); tableCellTextStyle.PrependChild( new Fonts( new LatinFont() { Typeface = typeface }, new ComplexScriptFont() { Typeface = typeface } ) ); return(this.result); }