Interface IProperty | Properties | 1.1.1-preview
docs.unity3d.com
    Show / Hide Table of Contents

    Interface IProperty

    Base interface for working with properties.

    Namespace: Unity.Properties
    Syntax
    public interface IProperty
    Remarks

    This is used to pass or store properties without knowing the underlying container or value type.

    • IProperty<TContainer>
    • Property<TContainer, TValue>

    Properties

    IsReadOnly

    Gets a value indicating whether the property is read-only or not.

    Declaration
    bool IsReadOnly { get; }
    Property Value
    Type Description
    Boolean

    Name

    Gets the name of the property.

    Declaration
    string Name { get; }
    Property Value
    Type Description
    String

    Methods

    DeclaredValueType()

    Returns the declared value type of the property.

    Declaration
    Type DeclaredValueType()
    Returns
    Type Description
    Type

    The declared value type.

    GetAttribute<TAttribute>()

    Returns the first attribute of the given type.

    Declaration
    TAttribute GetAttribute<TAttribute>()
        where TAttribute : Attribute
    Returns
    Type Description
    TAttribute

    The attribute of the given type for this property.

    Type Parameters
    Name Description
    TAttribute

    The attribute type to get.

    GetAttributes()

    Returns all attribute for this property.

    Declaration
    IEnumerable<Attribute> GetAttributes()
    Returns
    Type Description
    IEnumerable<Attribute>

    An IEnumerable<T> for all attributes.

    GetAttributes<TAttribute>()

    Returns all attribute of the given type.

    Declaration
    IEnumerable<TAttribute> GetAttributes<TAttribute>()
        where TAttribute : Attribute
    Returns
    Type Description
    IEnumerable<TAttribute>

    An IEnumerable<T> for all attributes of the given type.

    Type Parameters
    Name Description
    TAttribute

    The attribute type to get.

    HasAttribute<TAttribute>()

    Returns true if the property has any attributes of the given type.

    Declaration
    bool HasAttribute<TAttribute>()
        where TAttribute : Attribute
    Returns
    Type Description
    Boolean

    true if the property has the given attribute type; otherwise, false.

    Type Parameters
    Name Description
    TAttribute

    The attribute type to check for.

    Extension Methods

    PropertyVisitExtensions.Visit<TValue>(IProperty, PropertyVisitor, ref TValue)
    PropertyVisitExtensions.Visit<TValue>(IProperty, PropertyVisitor, ref TValue, Int32)
    PropertyVisitExtensions.Visit<TValue>(IProperty, PropertyVisitor, ref TValue, Object)
    PropertyAttributeExtensions.WithAttribute<TProperty>(TProperty, Attribute)
    PropertyAttributeExtensions.WithAttributes<TProperty>(TProperty, IEnumerable<Attribute>)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023