Click or drag to resize

pickPickT Method (IEnumerableT, Int32, RandomGenerator)

Namespace:  WhetStone.Random
Assembly:  WhetStone (in WhetStone.dll) Version: 1.0.4.0 (1.0.0.0)
Syntax
C#
public static IEnumerable<T> Pick<T>(
	this IEnumerable<T> this,
	int count,
	RandomGenerator gen = null
)

Parameters

this
Type: System.Collections.GenericIEnumerableT
The IEnumerableT to search in.
count
Type: SystemInt32
The number of elements to return.
gen (Optional)
Type: WhetStone.RandomRandomGenerator
The RandomGenerator to use to roll for a random element. for GlobalRandomGenerator.

Type Parameters

T
The type of the IEnumerableT.

Return Value

Type: IEnumerableT
count random elements from this.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerableT. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks

Running time: O(|this| * count / (count + 1))

The results are sorted by this's order.

See Also