예제 #1
0
        private void WriteInterleaverToDocument(IInterleave interleaver, TextWriter output)
        {
            HeaderFooterReferences headerFooterReferences = interleaver as HeaderFooterReferences;

            if (headerFooterReferences != null)
            {
                _sectionProperties.SetHeaderFooterReferences(headerFooterReferences);
                CT_P cT_P = new CT_P();
                cT_P.PPr = new CT_PPr
                {
                    SectPr = _sectionProperties.CtSectPr
                };
                cT_P.Write(output, CT_Body.PElementName);
                _sectionProperties.ResetHeadersAndFooters();
                if (_firstSection)
                {
                    _sectionProperties.Continuous = true;
                    _firstSection = false;
                }
            }
            else
            {
                interleaver.Write(output);
            }
        }
        public bool TryCreateObject(ObjectType objectType, out IPersistable persistObj)
        {
            switch (objectType)
            {
            case ObjectType.WordOpenXmlTableGrid:
                persistObj = new OpenXmlTableGridModel();
                break;

            case ObjectType.WordOpenXmlTableRowProperties:
                persistObj = new OpenXmlTableRowPropertiesModel();
                break;

            case ObjectType.WordOpenXmlBorderProperties:
                persistObj = new OpenXmlBorderPropertiesModel();
                break;

            case ObjectType.WordOpenXmlHeaderFooterReferences:
                persistObj = new HeaderFooterReferences();
                break;

            default:
                persistObj = null;
                return(false);
            }
            return(true);
        }
 private static List <Declaration> BuildDeclarations()
 {
     return(new List <Declaration>(6)
     {
         BaseInterleaver.GetDeclaration(),
         OpenXmlTableGridModel.GetDeclaration(),
         OpenXmlTableRowPropertiesModel.GetDeclaration(),
         OpenXmlBorderPropertiesModel.GetDeclaration(),
         HeaderFooterReferences.GetDeclaration()
     });
 }