Search Results for

    Show / Hide Table of Contents

    Class ProductAttributes

    A product's attributes, indexed once by attribute number (ordinal comparison).

    Inheritance
    object
    ProductAttributes
    Implements
    IReadOnlyCollection<ProductAttribute>
    IEnumerable<ProductAttribute>
    IEnumerable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Activout.Blue5.Attributes
    Assembly: Activout.Blue5.dll
    Syntax
    public sealed class ProductAttributes : IReadOnlyCollection<ProductAttribute>, IEnumerable<ProductAttribute>, IEnumerable

    Constructors

    | Edit this page View Source

    ProductAttributes(IEnumerable<ProductAttribute>)

    Indexes attributes by number. If a number repeats, the first one wins for lookups.

    Declaration
    public ProductAttributes(IEnumerable<ProductAttribute> attributes)
    Parameters
    Type Name Description
    IEnumerable<ProductAttribute> attributes

    Fields

    | Edit this page View Source

    Empty

    No attributes.

    Declaration
    public static readonly ProductAttributes Empty
    Field Value
    Type Description
    ProductAttributes

    Properties

    | Edit this page View Source

    Count

    Number of attributes.

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    int

    Methods

    | Edit this page View Source

    Contains(string)

    Whether the product has an attribute with the given number.

    Declaration
    public bool Contains(string number)
    Parameters
    Type Name Description
    string number
    Returns
    Type Description
    bool
    | Edit this page View Source

    Find(string)

    The raw attribute with the given number, or null.

    Declaration
    public ProductAttribute? Find(string number)
    Parameters
    Type Name Description
    string number
    Returns
    Type Description
    ProductAttribute
    | Edit this page View Source

    GetEnumerator()

    Returns an enumerator that iterates through the collection.

    Declaration
    public IEnumerator<ProductAttribute> GetEnumerator()
    Returns
    Type Description
    IEnumerator<ProductAttribute>

    An enumerator that can be used to iterate through the collection.

    | Edit this page View Source

    Get<T>(AttributeKey<T>)

    Returns the attribute value converted to T, or DefaultValue when the product has no value for it.

    Declaration
    public T Get<T>(AttributeKey<T> key)
    Parameters
    Type Name Description
    AttributeKey<T> key
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T
    Exceptions
    Type Condition
    AttributeConversionException

    The value exists but cannot be converted to T.

    Implements

    IReadOnlyCollection<T>
    IEnumerable<T>
    IEnumerable
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX