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

    Show / Hide Table of Contents

    WorksheetCustomPropertyCollection Class

    Namespace:
    GemBox.Spreadsheet
    Assembly:
    GemBox.Spreadsheet.dll

    Collection of worksheet custom properties. Supported in XLSX only.

    • C#
    • VB.NET
    public sealed class WorksheetCustomPropertyCollection : IEnumerable<KeyValuePair<String, String>>, IEnumerable
    Public NotInheritable Class WorksheetCustomPropertyCollection
        Implements IEnumerable(Of KeyValuePair(Of String, String)), IEnumerable
    Inheritance:
    System.Object
    WorksheetCustomPropertyCollection
    Implements
    System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.String>>
    System.Collections.IEnumerable

    Properties

    Count

    Gets the number of custom properties in the collection.

    • C#
    • VB.NET
    public int Count { get; }
    Public ReadOnly Property Count As Integer
    Property Value
    System.Int32

    Item[Int32]

    Gets or sets a custom property value by zero-based index.

    • C#
    • VB.NET
    public string this[int index] { get; set; }
    Public Property Item(index As Integer) As String
    Parameters
    index
    System.Int32
    Property Value
    System.String
    Exceptions
    System.ArgumentOutOfRangeException

    If the given index is less than 0 or greater than or equal to Count.

    Item[String]

    Gets or sets a custom property value by name.

    • C#
    • VB.NET
    public string this[string name] { get; set; }
    Public Property Item(name As String) As String
    Parameters
    name
    System.String
    Property Value
    System.String
    Exceptions
    System.ArgumentNullException

    If name is null.

    System.ArgumentNullException

    If value is null.

    System.Collections.Generic.KeyNotFoundException

    If the given name was not present.

    Methods

    Add(String, String)

    Adds a new custom property.

    • C#
    • VB.NET
    public void Add(string name, string value)
    Public Sub Add(name As String, value As String)
    Parameters
    name
    System.String

    Custom property name.

    value
    System.String

    Custom property value.

    Exceptions
    System.ArgumentNullException

    If name is null.

    System.ArgumentNullException

    If value is null.

    Clear()

    Removes all custom properties.

    • C#
    • VB.NET
    public void Clear()
    Public Sub Clear

    Contains(String)

    Determines whether a custom property is in the collection.

    • C#
    • VB.NET
    public bool Contains(string name)
    Public Function Contains(name As String) As Boolean
    Parameters
    name
    System.String

    Custom property name to locate in the collection.

    Returns
    System.Boolean

    true if custom property is found; otherwise false.

    Exceptions
    System.ArgumentNullException

    If name is null.

    GetEnumerator()

    Returns an enumerator for the collection.

    • C#
    • VB.NET
    public IEnumerator<KeyValuePair<string, string>> GetEnumerator()
    Public Function GetEnumerator As IEnumerator(Of KeyValuePair(Of String, String))
    Returns
    System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<System.String, System.String>>

    An enumerator for the collection.

    Remove(String)

    Removes a custom property by name.

    • C#
    • VB.NET
    public bool Remove(string name)
    Public Function Remove(name As String) As Boolean
    Parameters
    name
    System.String
    Returns
    System.Boolean

    true if removed; otherwise false.

    Exceptions
    System.ArgumentNullException

    If name is null.

    RemoveAt(Int32)

    Removes the custom property at the specified zero-based index.

    • C#
    • VB.NET
    public void RemoveAt(int index)
    Public Sub RemoveAt(index As Integer)
    Parameters
    index
    System.Int32
    Exceptions
    System.ArgumentOutOfRangeException

    If the given index is less than 0 or greater than or equal to Count.

    TryGetValue(String, out String)

    Attempts to get the value of a custom property with the specified name.

    • C#
    • VB.NET
    public bool TryGetValue(string name, out string value)
    Public Function TryGetValue(name As String, ByRef value As String) As Boolean
    Parameters
    name
    System.String

    Custom property name to locate in the collection.

    value
    System.String

    Custom property value associated with the specified name, if the name is found; otherwise null.

    Returns
    System.Boolean

    true if the collection contains a custom property with the specified name; otherwise, false.

    Exceptions
    System.ArgumentNullException

    If name is null.

    Implements

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

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.