GemBox.Document
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    HeaderFooterCollection Class

    Namespace:
    GemBox.Document
    Assembly:
    GemBox.Document.dll

    Represents a collection of HeaderFooter elements.

    • C#
    • VB.NET
    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.Object
    ElementCollection
    ElementCollection<HeaderFooter>
    HeaderFooterCollection
    Implements
    System.Collections.IList
    System.Collections.ICollection
    System.Collections.Generic.IList<HeaderFooter>
    System.Collections.Generic.ICollection<HeaderFooter>
    System.Collections.Generic.IEnumerable<HeaderFooter>
    System.Collections.IEnumerable
    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.

    • C#
    • VB.NET
    public HeaderFooter this[HeaderFooterType type] { get; }
    Public ReadOnly Property Item(type As HeaderFooterType) As HeaderFooter
    Parameters
    type
    HeaderFooterType

    The header / footer type.

    Property Value
    HeaderFooter

    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.

    • C#
    • VB.NET
    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
    HeaderFooter

    The element at the specified index.

    Methods

    GetOrAdd(HeaderFooterType)

    Gets the HeaderFooter that corresponds to given HeaderFooterType.

    • C#
    • VB.NET
    public HeaderFooter GetOrAdd(HeaderFooterType type)
    Public Function GetOrAdd(type As HeaderFooterType) As HeaderFooter
    Parameters
    type
    HeaderFooterType

    The HeaderFooterType instance.

    Returns
    HeaderFooter

    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)

    Implements

    System.Collections.IList
    System.Collections.ICollection
    System.Collections.Generic.IList<T>
    System.Collections.Generic.ICollection<T>
    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.