Class ReflectedMemberProperty<TContainer, TValue> | Properties | 1.1.1-preview
docs.unity3d.com
    Show / Hide Table of Contents

    Class ReflectedMemberProperty<TContainer, TValue>

    A ReflectedMemberProperty<TContainer, TValue> provides strongly typed access to an underlying FieldInfo or PropertyInfo object.

    Inheritance
    Object
    Property<TContainer, TValue>
    ReflectedMemberProperty<TContainer, TValue>
    Inherited Members
    Property<TContainer, TValue>.Name
    Property<TContainer, TValue>.IsReadOnly
    Property<TContainer, TValue>.DeclaredValueType()
    Property<TContainer, TValue>.IProperty<TContainer>.GetValue(TContainer)
    Property<TContainer, TValue>.IProperty<TContainer>.TrySetValue(TContainer, Object)
    Property<TContainer, TValue>.GetValue(TContainer)
    Property<TContainer, TValue>.SetValue(TContainer, TValue)
    Property<TContainer, TValue>.AddAttribute(Attribute)
    Property<TContainer, TValue>.AddAttributes(IEnumerable<Attribute>)
    Property<TContainer, TValue>.HasAttribute<TAttribute>()
    Property<TContainer, TValue>.GetAttribute<TAttribute>()
    Property<TContainer, TValue>.GetAttributes<TAttribute>()
    Property<TContainer, TValue>.GetAttributes()
    Namespace: Unity.Properties
    Syntax
    public class ReflectedMemberProperty<TContainer, TValue> : Property<TContainer, TValue>, IProperty<TContainer>, IProperty, IPropertyAccept<TContainer>, IAttributes
    Type Parameters
    Name Description
    TContainer

    The container type for this property.

    TValue

    The value type for this property.

    Remarks

    The implementation uses slow reflection calls internally. This is intended to be used as an intermediate solution for quick editor iteration.

    Constructors

    ReflectedMemberProperty(FieldInfo)

    Initializes a new ReflectedMemberProperty<TContainer, TValue> instance for the specified FieldInfo.

    Declaration
    public ReflectedMemberProperty(FieldInfo info)
    Parameters
    Type Name Description
    FieldInfo info

    The system reflection field info.

    ReflectedMemberProperty(PropertyInfo)

    Initializes a new ReflectedMemberProperty<TContainer, TValue> instance for the specified PropertyInfo.

    Declaration
    public ReflectedMemberProperty(PropertyInfo info)
    Parameters
    Type Name Description
    PropertyInfo info

    The system reflection property info.

    Properties

    IsReadOnly

    Declaration
    public override bool IsReadOnly { get; }
    Property Value
    Type Description
    Boolean
    Overrides
    Unity.Properties.Property<TContainer, TValue>.IsReadOnly

    Name

    Declaration
    public override string Name { get; }
    Property Value
    Type Description
    String
    Overrides
    Unity.Properties.Property<TContainer, TValue>.Name

    Methods

    GetValue(ref TContainer)

    Declaration
    public override TValue GetValue(ref TContainer container)
    Parameters
    Type Name Description
    TContainer container
    Returns
    Type Description
    TValue
    Overrides
    Unity.Properties.Property<TContainer, TValue>.GetValue(TContainer)

    SetValue(ref TContainer, TValue)

    Declaration
    public override void SetValue(ref TContainer container, TValue value)
    Parameters
    Type Name Description
    TContainer container
    TValue value
    Overrides
    Unity.Properties.Property<TContainer, TValue>.SetValue(TContainer, TValue)

    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