Beispiel #1
0
        /// <summary>
        /// Converts HeaderFooter into DDL.
        /// </summary>
        internal override void Serialize(Serializer serializer)
        {
            HeadersFooters headersfooters = (HeadersFooters)_parent;

            if (headersfooters.Primary == this)
            {
                Serialize(serializer, "primary");
            }
            else if (headersfooters.EvenPage == this)
            {
                Serialize(serializer, "evenpage");
            }
            else if (headersfooters.FirstPage == this)
            {
                Serialize(serializer, "firstpage");
            }
        }
Beispiel #2
0
        /// <summary>
        /// Implements the deep copy of the object.
        /// </summary>
        protected override object DeepCopy()
        {
            HeadersFooters headersFooters = (HeadersFooters)base.DeepCopy();

            if (headersFooters._evenPage != null)
            {
                headersFooters._evenPage         = headersFooters._evenPage.Clone();
                headersFooters._evenPage._parent = headersFooters;
            }
            if (headersFooters._firstPage != null)
            {
                headersFooters._firstPage         = headersFooters._firstPage.Clone();
                headersFooters._firstPage._parent = headersFooters;
            }
            if (headersFooters._primary != null)
            {
                headersFooters._primary         = headersFooters._primary.Clone();
                headersFooters._primary._parent = headersFooters;
            }
            return(headersFooters);
        }
Beispiel #3
0
        private HeaderFooter ChooseHeaderFooter(HeadersFooters hfs, PagePosition pagePos)
        {
            if (hfs == null)
                return null;

            PageSetup pageSetup = _currentSection.PageSetup;

            if (pagePos == PagePosition.First)
            {
                if (pageSetup.DifferentFirstPageHeaderFooter)
                    return (HeaderFooter)hfs.GetValue("FirstPage", GV.ReadOnly);
            }
            if (pagePos == PagePosition.Even || _shownPageNumber/*_currentPage*/ % 2 == 0)
            {
                if (pageSetup.OddAndEvenPagesHeaderFooter)
                    return (HeaderFooter)hfs.GetValue("EvenPage", GV.ReadOnly);
            }
            return (HeaderFooter)hfs.GetValue("Primary", GV.ReadOnly);
        }
 internal HeadersFootersRenderer(DocumentObject domObj, RtfDocumentRenderer docRenderer)
     : base(domObj, docRenderer)
 {
     this.headersFooters = domObj as HeadersFooters;
 }