SetType() public méthode

public SetType ( int type ) : void
type int
Résultat void
        /**
         * Set a RtfHeaderFooter to be displayed at a certain position
         *
         * @param headerFooter The RtfHeaderFooter to display
         * @param displayAt The display location to use
         */
        public void SetHeaderFooter(RtfHeaderFooter headerFooter, int displayAt)
        {
            this.mode = MODE_MULTIPLE;
            headerFooter.SetRtfDocument(this.document);
            headerFooter.SetType(this.type);
            headerFooter.SetDisplayAt(displayAt);
            switch (displayAt)
            {
            case RtfHeaderFooter.DISPLAY_ALL_PAGES:
                headerAll = headerFooter;
                break;

            case RtfHeaderFooter.DISPLAY_FIRST_PAGE:
                headerFirst = headerFooter;
                break;

            case RtfHeaderFooter.DISPLAY_LEFT_PAGES:
                headerLeft = headerFooter;
                break;

            case RtfHeaderFooter.DISPLAY_RIGHT_PAGES:
                headerRight = headerFooter;
                break;
            }
        }
        /// <summary>
        /// Set a RtfHeaderFooter to be displayed at a certain position
        /// </summary>
        /// <param name="headerFooter">The RtfHeaderFooter to display</param>
        /// <param name="displayAt">The display location to use</param>
        public void SetHeaderFooter(RtfHeaderFooter headerFooter, int displayAt)
        {
            _mode = ModeMultiple;
            headerFooter.SetRtfDocument(_document);
            headerFooter.SetType(_type);
            headerFooter.SetDisplayAt(displayAt);
            switch (displayAt)
            {
            case RtfHeaderFooter.DISPLAY_ALL_PAGES:
                _headerAll = headerFooter;
                break;

            case RtfHeaderFooter.DISPLAY_FIRST_PAGE:
                _headerFirst = headerFooter;
                break;

            case RtfHeaderFooter.DISPLAY_LEFT_PAGES:
                _headerLeft = headerFooter;
                break;

            case RtfHeaderFooter.DISPLAY_RIGHT_PAGES:
                _headerRight = headerFooter;
                break;
            }
        }
 /// <summary>
 /// Set that this RtfHeaderFooterGroup should have facing pages. If only
 /// a header / footer for all pages exists, then it will be copied to the left
 /// and right pages aswell.
 /// </summary>
 public void SetHasFacingPages()
 {
     if (_mode == ModeSingle)
     {
         _mode       = ModeMultiple;
         _headerLeft = new RtfHeaderFooter(_document, _headerAll, RtfHeaderFooter.DISPLAY_LEFT_PAGES);
         _headerLeft.SetType(_type);
         _headerRight = new RtfHeaderFooter(_document, _headerAll, RtfHeaderFooter.DISPLAY_RIGHT_PAGES);
         _headerRight.SetType(_type);
         _headerAll = null;
     }
     else if (_mode == ModeMultiple)
     {
         if (_headerLeft == null && _headerAll != null)
         {
             _headerLeft = new RtfHeaderFooter(_document, _headerAll, RtfHeaderFooter.DISPLAY_LEFT_PAGES);
             _headerLeft.SetType(_type);
         }
         if (_headerRight == null && _headerAll != null)
         {
             _headerRight = new RtfHeaderFooter(_document, _headerAll, RtfHeaderFooter.DISPLAY_RIGHT_PAGES);
             _headerRight.SetType(_type);
         }
         _headerAll = null;
     }
 }
 /**
  * Constructs a RtfHeaderGroup for a certain HeaderFooter
  *
  * @param doc The RtfDocument this RtfHeaderFooter belongs to
  * @param headerFooter The HeaderFooter to display
  * @param type The typ of RtfHeaderFooterGroup to create
  */
 public RtfHeaderFooterGroup(RtfDocument doc, HeaderFooter headerFooter, int type) : base(new Phrase(""), false)
 {
     this.document = doc;
     this.type     = type;
     this.mode     = MODE_SINGLE;
     headerAll     = new RtfHeaderFooter(doc, headerFooter, type, RtfHeaderFooter.DISPLAY_ALL_PAGES);
     headerAll.SetType(this.type);
 }
 /// <summary>
 /// Constructs a RtfHeaderGroup for a certain HeaderFooter
 /// </summary>
 /// <param name="doc">The RtfDocument this RtfHeaderFooter belongs to</param>
 /// <param name="headerFooter">The HeaderFooter to display</param>
 /// <param name="type">The typ of RtfHeaderFooterGroup to create</param>
 public RtfHeaderFooterGroup(RtfDocument doc, HeaderFooter headerFooter, int type) : base(new Phrase(""), false)
 {
     _document  = doc;
     _type      = type;
     _mode      = ModeSingle;
     _headerAll = new RtfHeaderFooter(doc, headerFooter, type, RtfHeaderFooter.DISPLAY_ALL_PAGES);
     _headerAll.SetType(_type);
 }
 /**
  * Set that this RtfHeaderFooterGroup should have a title page. If only
  * a header / footer for all pages exists, then it will be copied to the
  * first page aswell.
  */
 public void SetHasTitlePage()
 {
     if (this.mode == MODE_SINGLE)
     {
         this.mode   = MODE_MULTIPLE;
         headerFirst = new RtfHeaderFooter(this.document, headerAll, RtfHeaderFooter.DISPLAY_FIRST_PAGE);
         headerFirst.SetType(this.type);
     }
 }
 /// <summary>
 /// Set that this RtfHeaderFooterGroup should have a title page. If only
 /// a header / footer for all pages exists, then it will be copied to the
 /// first page aswell.
 /// </summary>
 public void SetHasTitlePage()
 {
     if (_mode == ModeSingle)
     {
         _mode        = ModeMultiple;
         _headerFirst = new RtfHeaderFooter(_document, _headerAll, RtfHeaderFooter.DISPLAY_FIRST_PAGE);
         _headerFirst.SetType(_type);
     }
 }
 /**
  * Set the type of this RtfHeaderFooterGroup. RtfHeaderFooter.TYPE_HEADER
  * or RtfHeaderFooter.TYPE_FOOTER. Also sets the type for all RtfHeaderFooters
  * of this RtfHeaderFooterGroup.
  *
  * @param type The type to use
  */
 public void SetType(int type)
 {
     this.type = type;
     if (headerAll != null)
     {
         headerAll.SetType(this.type);
     }
     if (headerFirst != null)
     {
         headerFirst.SetType(this.type);
     }
     if (headerLeft != null)
     {
         headerLeft.SetType(this.type);
     }
     if (headerRight != null)
     {
         headerRight.SetType(this.type);
     }
 }
 /// <summary>
 /// Set the type of this RtfHeaderFooterGroup. RtfHeaderFooter.TYPE_HEADER
 /// or RtfHeaderFooter.TYPE_FOOTER. Also sets the type for all RtfHeaderFooters
 /// of this RtfHeaderFooterGroup.
 /// </summary>
 /// <param name="type">The type to use</param>
 public void SetType(int type)
 {
     _type = type;
     if (_headerAll != null)
     {
         _headerAll.SetType(_type);
     }
     if (_headerFirst != null)
     {
         _headerFirst.SetType(_type);
     }
     if (_headerLeft != null)
     {
         _headerLeft.SetType(_type);
     }
     if (_headerRight != null)
     {
         _headerRight.SetType(_type);
     }
 }
 /**
 * Set a RtfHeaderFooter to be displayed at a certain position
 *
 * @param headerFooter The RtfHeaderFooter to display
 * @param displayAt The display location to use
 */
 public void SetHeaderFooter(RtfHeaderFooter headerFooter, int displayAt)
 {
     this.mode = MODE_MULTIPLE;
     headerFooter.SetRtfDocument(this.document);
     headerFooter.SetType(this.type);
     headerFooter.SetDisplayAt(displayAt);
     switch (displayAt) {
         case RtfHeaderFooter.DISPLAY_ALL_PAGES:
             headerAll = headerFooter;
             break;
         case RtfHeaderFooter.DISPLAY_FIRST_PAGE:
             headerFirst = headerFooter;
             break;
         case RtfHeaderFooter.DISPLAY_LEFT_PAGES:
             headerLeft = headerFooter;
             break;
         case RtfHeaderFooter.DISPLAY_RIGHT_PAGES:
             headerRight = headerFooter;
             break;
     }
 }
 /**
 * Set that this RtfHeaderFooterGroup should have a title page. If only
 * a header / footer for all pages exists, then it will be copied to the
 * first page aswell.
 */
 public void SetHasTitlePage()
 {
     if (this.mode == MODE_SINGLE) {
         this.mode = MODE_MULTIPLE;
         headerFirst = new RtfHeaderFooter(this.document, headerAll, RtfHeaderFooter.DISPLAY_FIRST_PAGE);
         headerFirst.SetType(this.type);
     }
 }
 /**
 * Constructs a RtfHeaderGroup for a certain HeaderFooter
 *
 * @param doc The RtfDocument this RtfHeaderFooter belongs to
 * @param headerFooter The HeaderFooter to display
 * @param type The typ of RtfHeaderFooterGroup to create
 */
 public RtfHeaderFooterGroup(RtfDocument doc, HeaderFooter headerFooter, int type)
     : base(new Phrase(""), false)
 {
     this.document = doc;
     this.type = type;
     this.mode = MODE_SINGLE;
     headerAll = new RtfHeaderFooter(doc, headerFooter, type, RtfHeaderFooter.DISPLAY_ALL_PAGES);
     headerAll.SetType(this.type);
 }