 | enumerationHookEnumerationHookT Method (IEnumerableT, FuncT, Boolean, FuncT, Boolean) |
Namespace:
WhetStone.Looping
Assembly:
WhetStone (in WhetStone.dll) Version: 1.0.4.0 (1.0.0.0)
Syntaxpublic static IEnumerable<T> EnumerationHook<T>(
this IEnumerable<T> this,
Func<T, bool> preYield = null,
Func<T, bool> postYield = null
)
Parameters
- this
- Type: System.Collections.GenericIEnumerableT
The IEnumerableT to hook to. - preYield (Optional)
- Type: SystemFuncT, Boolean
An ActionT to call before the element is returned to the enumeration caller. If the function returns , it will not be called again (but the IEnumerableT will still be enumerated). - postYield (Optional)
- Type: SystemFuncT, Boolean
An ActionT to call before the element is returned to the enumeration caller (if the next item is requested). If the function returns , it will not be called again (but the IEnumerableT will still be enumerated).
Type Parameters
- T
- The type of the IEnumerableT.
Return Value
Type:
IEnumerableTAn enumerable with the same elements, but whenever enumerated, will trigger a hooked method.
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).
See Also