docs.unity3d.com
    Show / Hide Table of Contents

    Class TupleExtensions

    Extensions for s.

    Inheritance
    Object
    TupleExtensions
    Namespace: UnityEngine.Localization.SmartFormat.Utilities
    Syntax
    public static class TupleExtensions : object
    Remarks

    Credits to James Esh for the code posted on https://stackoverflow.com/questions/46707556/detect-if-an-object-is-a-valuetuple

    Methods

    GetValueTupleItemFields(Type)

    A list of s with the fields of a .

    Declaration
    public static List<FieldInfo> GetValueTupleItemFields(this Type tupleType)
    Parameters
    Type Name Description
    Type tupleType
    Returns
    Type Description
    List<FieldInfo>

    Returns of list of s with the fields of a .

    GetValueTupleItemObjects(Object)

    A list of s with the values for each field.

    Declaration
    public static IEnumerable<object> GetValueTupleItemObjects(this object tuple)
    Parameters
    Type Name Description
    Object tuple
    Returns
    Type Description
    IEnumerable<Object>

    Returns a list of s with the values for each field.

    GetValueTupleItemObjectsFlattened(Object)

    Declaration
    public static IEnumerable<object> GetValueTupleItemObjectsFlattened(this object tuple)
    Parameters
    Type Name Description
    Object tuple
    Returns
    Type Description
    IEnumerable<Object>

    GetValueTupleItemTypes(Type)

    A list of s for the fields of a .

    Declaration
    public static IEnumerable<Type> GetValueTupleItemTypes(this Type tupleType)
    Parameters
    Type Name Description
    Type tupleType
    Returns
    Type Description
    IEnumerable<Type>

    Returns of list of s with the fields of a .

    IsValueTuple(Object)

    Extension method to check whether an object is of type

    Declaration
    public static bool IsValueTuple(this object obj)
    Parameters
    Type Name Description
    Object obj
    Returns
    Type Description
    Boolean

    Returns true, if the object is of type .

    IsValueTupleType(Type)

    Extension method to check whether the given type is a

    Declaration
    public static bool IsValueTupleType(this Type type)
    Parameters
    Type Name Description
    Type type
    Returns
    Type Description
    Boolean

    Returns true, if the type is a .

    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