Class TupleExtensions
Extensions for
Namespace: UnityEngine.Localization.SmartFormat.Utilities
Syntax
public static class TupleExtensions
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 FieldInfos 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 FieldInfos with the fields of a |
GetValueTupleItemObjects(Object)
A list of Objects with the values for each
Declaration
public static IEnumerable<object> GetValueTupleItemObjects(this object tuple)
Parameters
Type | Name | Description |
---|---|---|
Object | tuple |
Returns
Type | Description |
---|---|
IEnumerable<Object> | Returns a list of Objects with the values for each |
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 Types 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 Types 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 |
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 |