Click or drag to resize
AlgorithmsNCopiesOfT Method
Creates an IEnumerator that enumerates a given item n times.

Namespace: X3Platform.Collections
Assembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntax
public static IEnumerable<T> NCopiesOf<T>(
	int n,
	T item
)

Parameters

n
Type: SystemInt32
The number of times to enumerate the item.
item
Type: T
The item that should occur in the enumeration.

Type Parameters

T

[Missing <typeparam name="T"/> documentation for "M:X3Platform.Collections.Algorithms.NCopiesOf``1(System.Int32,``0)"]

Return Value

Type: IEnumerableT
An IEnumerable<T> that yields n copies of item.
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptionThe argument n is less than zero.
Examples
The following creates a list consisting of 1000 copies of the double 1.0.
List<double> list = new List<double>(Algorithms.NCopiesOf(1000, 1.0));
See Also