internal void Export(XmlWriter writer) { // Font writer.WriteStartElement("Font"); writer.WriteAttributeString("ss", "FontName", null, this.Name); if (this.Size != 0) { writer.WriteAttributeString("ss", "Size", null, this.Size.ToString( CultureInfo.InvariantCulture)); } // Color writer.WriteAttributeString("ss", "Color", null, XmlStyle.ColorToExcelFormat(this.Color)); // Bold? if (this.Bold) { writer.WriteAttributeString("ss", "Bold", null, "1"); } // Italic? if (this.Italic) { writer.WriteAttributeString("ss", "Italic", null, "1"); } // Underline? if (this.Underline) { writer.WriteAttributeString("ss", "Underline", null, "Single"); } if (this.Strikeout) { writer.WriteAttributeString("ss", "Strikeout", null, "1"); } // Font end writer.WriteEndElement(); }
internal void Export(XmlWriter writer) { if (this.Color != Color.Empty || this.PatternColor != Color.Empty) { // Interior start writer.WriteStartElement("Interior"); if (this.Color != Color.Empty) { writer.WriteAttributeString("ss", "Color", null, XmlStyle.ColorToExcelFormat(this.Color)); } if (this.PatternColor != Color.Empty) { writer.WriteAttributeString("ss", "PatternColor", null, XmlStyle.ColorToExcelFormat(this.PatternColor)); } writer.WriteAttributeString("ss", "Pattern", null, this.Pattern.ToString()); // Interior end writer.WriteEndElement(); } }