HeaderFooterCollection Class
Represents a collection of HeaderFooter elements.
public sealed class HeaderFooterCollection : ElementCollection<HeaderFooter>, IList, ICollection, IList<HeaderFooter>, ICollection<HeaderFooter>, IEnumerable<HeaderFooter>, IEnumerable
Public NotInheritable Class HeaderFooterCollection
Inherits ElementCollection(Of HeaderFooter)
Implements IList, ICollection, IList(Of HeaderFooter), ICollection(Of HeaderFooter), IEnumerable(Of HeaderFooter), IEnumerable
- Inheritance:
- System.ObjectHeaderFooterCollection
Implements
Remarks
HeaderFooterCollection cannot contain multiple HeaderFooter elements with equal HeaderFooterType.
Following rules apply for HeaderFooterType headers / footers contained in a collection:
- HeaderDefault / FooterDefault - header / footer will be applied to every page in a section.
- HeaderEven / FooterEven - header / footer will be applied to only even pages in a section. Overrides HeaderDefault / FooterDefault on even pages, if also contained in a collection.
- HeaderFirst / FooterFirst - header / footer will be applied to only first page in a section. Overrides both HeaderDefault / FooterDefault and HeaderEven / FooterEven on first page, if also contained in a collection.
Properties
Item[HeaderFooterType]
Gets the HeaderFooter with the specified type. Returns null if collection doesn't contain HeaderFooter with the specified type.
public HeaderFooter this[HeaderFooterType type] { get; }
Public ReadOnly Property Item(type As HeaderFooterType) As HeaderFooter
Parameters
type
- HeaderFooterType
The header / footer type.
Property Value
The HeaderFooter with the specified type or null if collection doesn't contain HeaderFooter with the specified type.
Item[Int32]
Gets or sets the element at the specified index.
public HeaderFooter this[int index] { get; set; }
Public Property Item(index As Integer) As HeaderFooter
Parameters
index
- System.Int32
The zero-based index of the element to get or set.
Property Value
The element at the specified index.
Methods
GetOrAdd(HeaderFooterType)
Gets the HeaderFooter that corresponds to given HeaderFooterType.
public HeaderFooter GetOrAdd(HeaderFooterType type)
Public Function GetOrAdd(type As HeaderFooterType) As HeaderFooter
Parameters
type
- HeaderFooterType
The HeaderFooterType instance.
Returns
HeaderFooter that corresponds to given HeaderFooterType.
Remarks
Gets the HeaderFooter that corresponds to given HeaderFooterType. If HeaderFooterCollection doesn't contain correspondent header or footer element, then the element will be added and returned.
Inherited Properties
Content | Gets the content of the current ElementCollection. (Inherited from ElementCollection) |
SupportedElementTypes | Gets a sequence of ElementTypes that can be contained in this collection. (Inherited from ElementCollection) |
Inherited Methods
CopyTo(Element[], System.Int32) | Copies the elements of the ElementCollection to an System.Array, starting at a particular System.Array index. (Inherited from ElementCollection) |
IndexOf(Element) | Determines the index of a specific Element in the ElementCollection. (Inherited from ElementCollection) |