Class Arguments
- Namespace
- Cuemon.Collections.Generic
- Assembly
- Cuemon.Kernel.dll
Provides static helper methods for wrapping, projecting, and concatenating arguments as arrays and enumerable sequences.
public static class Arguments
- Inheritance
-
Arguments
Methods
Concat<T>(T[], T[])
Concatenates two arrays.
public static T[] Concat<T>(T[] args1, T[] args2)
Parameters
args1T[]The first array to concatenate.
args2T[]The array to concatenate to the first array.
Returns
- T[]
A new array that contains the elements of
args1followed by the elements ofargs2.
Type Parameters
TThe type of the elements of the input arrays.
ToArray(params object[])
Returns the specified arguments as an array of Object.
public static object[] ToArray(params object[] args)
Parameters
Returns
- object[]
The specified
args.
Remarks
This method performs no conversion. It simply returns the supplied arguments as an array of Object.
ToArrayOf<T>(params T[])
Returns the specified arguments as an array of T.
public static T[] ToArrayOf<T>(params T[] args)
Parameters
argsT[]The arguments to return as an array of
T.
Returns
- T[]
The specified
args.
Type Parameters
TThe type of the elements in
args.
Remarks
This method performs no conversion. It simply returns the supplied arguments as a T array.
ToEnumerable(params object[])
Returns the specified arguments as an IEnumerable<T> of Object.
public static IEnumerable<object> ToEnumerable(params object[] args)
Parameters
Returns
- IEnumerable<object>
The specified
argsexposed as an IEnumerable<T> of Object.
Remarks
This method performs no conversion. It simply exposes the supplied arguments through the IEnumerable<T> interface.
ToEnumerableOf<T>(params T[])
Returns the specified arguments as an IEnumerable<T>.
public static IEnumerable<T> ToEnumerableOf<T>(params T[] args)
Parameters
argsT[]The arguments to return as an IEnumerable<T>.
Returns
- IEnumerable<T>
The specified
argsexposed as an IEnumerable<T>.
Type Parameters
TThe type of the elements in
args.
Remarks
This method performs no conversion. It simply exposes the supplied arguments through the IEnumerable<T> interface.
Yield<T>(T)
Returns an IEnumerable<T> with the specified arg as the only element.
public static IEnumerable<T> Yield<T>(T arg)
Parameters
argTThe
Tto type as IEnumerable<T>.
Returns
- IEnumerable<T>
An IEnumerable<T> with the specified
argas the only element.
Type Parameters
TThe type of the element of
arg.
Remarks
The Yield<T>(T) method has no effect other than to change the compile-time type of arg from T to IEnumerable<T>.