docs.unity3d.com
    Show / Hide Table of Contents

    Interface IPropertyBag<TContainer>

    Base typed interface for implementing property bags.

    Inherited Members
    IPropertyBag.Accept(ITypeVisitor)
    IPropertyBag.Accept(IPropertyBagVisitor, Object)
    Namespace: Unity.Properties
    Syntax
    public interface IPropertyBag<TContainer> : IPropertyBag
    Type Parameters
    Name Description
    TContainer

    The container type.

    Methods

    Accept(IPropertyBagVisitor, ref TContainer)

    Call this method to invoke Visit<TContainer>(IPropertyBag<TContainer>, ref TContainer) with the strongly typed container.

    Declaration
    void Accept(IPropertyBagVisitor visitor, ref TContainer container)
    Parameters
    Type Name Description
    IPropertyBagVisitor visitor

    The visitor being run.

    TContainer container

    The container being visited.

    CreateInstance()

    Creates and returns a new instance of .

    Declaration
    TContainer CreateInstance()
    Returns
    Type Description
    TContainer

    A new instance of .

    GetProperties()

    Returns an enumerator that iterates through all static properties for the type.

    Declaration
    PropertyCollection<TContainer> GetProperties()
    Returns
    Type Description
    PropertyCollection<TContainer>

    A IEnumerator<T> structure for all properties.

    Remarks

    This should return a subset properties returned by GetProperties(ref TContainer).

    GetProperties(ref TContainer)

    Returns an enumerator that iterates through all static and dynamic properties for the given container.

    Declaration
    PropertyCollection<TContainer> GetProperties(ref TContainer container)
    Parameters
    Type Name Description
    TContainer container

    The container hosting the data.

    Returns
    Type Description
    PropertyCollection<TContainer>

    A IEnumerator<T> structure for all properties.

    Remarks

    This should return all static properties returned by GetProperties() in addition to any dynamic properties. If the container is a collection type all elements will be iterated.

    TryCreateInstance(out TContainer)

    Tries to create a new instance of .

    Declaration
    bool TryCreateInstance(out TContainer instance)
    Parameters
    Type Name Description
    TContainer instance

    When this method returns, contains the created instance, if type construction succeeded; otherwise, the default value for TContainer.

    Returns
    Type Description
    Boolean

    true if a new instance of type was created; otherwise, false.

    Back to top
    Terms of use
    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