Click or drag to resize

asListAsListT Method (IEnumerableT, Boolean, Boolean)

Tries to cast or wrap this in a list adapter.

Namespace:  WhetStone.Looping
Assembly:  WhetStone (in WhetStone.dll) Version: 1.0.4.0 (1.0.0.0)
Syntax
C#
public static IList<T> AsList<T>(
	this IEnumerable<T> this,
	bool force = true,
	bool ensureReadOnly = false
)

Parameters

this
Type: System.Collections.GenericIEnumerableT
The IEnumerableT to convert to list.
force (Optional)
Type: SystemBoolean
If this is set to , and no suitable wrappings to IListT is found, a new IListT will be allocated and written to.
ensureReadOnly (Optional)
Type: SystemBoolean
Whether to force the returned value to be immutable (or null, if force is set to )

Type Parameters

T
The type of the IEnumerableT.

Return Value

Type: IListT
An IListT that contains this's elements, or if the conversion was not successful.

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
See Also