public OpenXmlDocumentModel(Stream output, WordOpenXmlWriter.CreateXmlStream createXmlStream, ScalabilityCache scalabilityCache) { _createXmlStream = createXmlStream; _zipPackage = Package.Open(output, FileMode.Create); _documentPart = (_currentPart = new PartInfo()); _currentPart.Part = new DocumentPart(); _manager = new PartManager(ZipPackage); Relationship relationship = _manager.AddStreamingRootPartToTree("application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", "word/document.xml"); WriteStylesheet(); WriteSettings(); _currentPart.PartName = relationship.RelatedPart; _currentPart.Stream = _createXmlStream("document"); _currentPart.Writer = new InterleavingWriter(_currentPart.Stream, scalabilityCache); _currentHeaderFooterReferences = default(TemporaryHeaderFooterReferences); _tags = new Stack <OoxmlComplexType>(); _currentPart.Writer.TextWriter.Write(OoxmlPart.XmlDeclaration); CT_Document cT_Document = new CT_Document(); cT_Document.WriteOpenTag(_currentPart.Writer.TextWriter, _currentPart.Part.Tag, _currentPart.Part.Namespaces); _tags.Push(cT_Document); CT_Body ctObject = new CT_Body(); WriteStartTag(ctObject, CT_Document.BodyElementName); _currentPart.TableContext = new TableContext(_currentPart.Writer, inHeaderFooter: false); _listManager = new OpenXmlListNumberingManager(); _sectionProperties = new OpenXmlSectionPropertiesModel(); }
public void WriteSectionBreak() { _currentPart.Writer.WriteInterleaver(_currentHeaderFooterReferences.Store); _currentHeaderFooterReferences = default(TemporaryHeaderFooterReferences); if (_firstSection) { _sectionProperties.Continuous = true; _firstSection = false; } }
public void WriteSectionBreak() { this._currentPart.Writer.WriteInterleaver(((TemporaryHeaderFooterReferences)(object)this._currentHeaderFooterReferences).Store); this._currentHeaderFooterReferences = default(TemporaryHeaderFooterReferences); if (this._firstSection) { this._sectionProperties.Continuous = true; this._firstSection = false; } }