private void WriteStandaloneTag(OoxmlComplexType tag, StreamSheetSection section, string tagname) { if (tag != null) { if (this._currentSection != section) { this.TryMoveToSection(section, 1); } tag.Write(this._output, tagname, 1, this.Namespaces); } }
private void WriteTagInCollection <TCol>(OoxmlComplexType tag, StreamSheetSection section, string tagname, string coltagname) where TCol : OoxmlComplexType, new() { if (tag != null) { if (this._currentSection != section) { this.TryMoveToSection(section, 1); this._pendingCloseTag = coltagname; TCol val = new TCol(); val.WriteOpenTag(this._output, coltagname, 1, this.Namespaces, false); } tag.Write(this._output, tagname, 2, this.Namespaces); } }
protected static void WriteRawTag(TextWriter s, int depth, Dictionary <string, string> namespaces, string tagname, bool preserveWhitespace, string tagNamespace, object data) { s.Write("<"); OoxmlComplexType.WriteXmlPrefix(s, namespaces, tagNamespace); s.Write(tagname); if (preserveWhitespace) { s.Write(" xml:space=\"preserve\""); } s.Write(">"); OoxmlComplexType.WriteData(s, data); s.Write("</"); OoxmlComplexType.WriteXmlPrefix(s, namespaces, tagNamespace); s.Write(tagname); s.Write(">"); }
protected static void WriteRawTag(TextWriter s, int depth, Dictionary <string, string> namespaces, string tagname, string tagNamespace, object data) { OoxmlComplexType.WriteRawTag(s, depth, namespaces, tagname, false, tagNamespace, data); }
public void WriteTag(OoxmlComplexType tag) { if (tag != null) { if (!(tag is CT_SheetPr)) { if (tag is CT_SheetView) { this.WriteSheetView((CT_SheetView)tag); return; } if (tag is CT_SheetFormatPr) { this.WriteSheetFormatProperties((CT_SheetFormatPr)tag); return; } if (tag is CT_Col) { this.WriteColumnProperty((CT_Col)tag); return; } if (tag is CT_Row) { this.WriteRow((CT_Row)tag); return; } if (tag is CT_MergeCell) { this.WriteMergedCell((CT_MergeCell)tag); return; } if (tag is CT_Hyperlink) { this.WriteHyperlink((CT_Hyperlink)tag); return; } if (tag is CT_PageMargins) { this.WritePageMargins((CT_PageMargins)tag); return; } if (tag is CT_PageSetup) { this.WritePageSetup((CT_PageSetup)tag); return; } if (tag is CT_HeaderFooter) { this.WriteHeaderFooter((CT_HeaderFooter)tag); return; } if (tag is CT_Drawing) { this.WriteDrawing((CT_Drawing)tag); return; } if (tag is CT_SheetBackgroundPicture) { this.WritePicture((CT_SheetBackgroundPicture)tag); return; } throw new FatalException(); } this.WriteSheetProperties((CT_SheetPr)tag); } }