Extensions for the IEnumerable interface type.
More...
|
static IEnumerable< TResult > | SelectIfUnique< TSource, TResult > (this IEnumerable< TSource > source, Func< TSource, TResult > selector) |
| Similar to the regular Select Linq method except that it only includes selected values that are unique. More...
|
|
static void | ForEach< TSource > (this IEnumerable< TSource > source, Action< TSource > action) |
| Performs the specified action on each source element. More...
|
|
static void | ForEach< TSource, TDiscardedResult > (this IEnumerable< TSource > source, Func< TSource, TDiscardedResult > func) |
| Performs the specified func on each source element, and discards the result. More...
|
|
static IEnumerable< TResult > | SelectIf< TSource, TResult > (this IEnumerable< TSource > source, Func< TSource, TResult > selector, Func< TSource, bool > predicate) |
| Does the same thing as the standard Linq Select() method, except this one uses a predicate and applies the selector only when the predicate returns true . More...
|
|
static IEnumerable< TSource > | SelectValues< TSource > (this IEnumerable< TSource > source) |
| Selects non-null values from the enumerable. More...
|
|
static IEnumerable< TResult > | SelectValues< TSource, TResult > (this IEnumerable< TSource > source, Func< TSource, TResult?> selector) |
| Selects non-null values from the enumerable using the specified selector . More...
|
|
static IEnumerable< TResult > | Select< TResult > (this IEnumerable source, Func< object, TResult > selector) |
| Applies the specified selector to each element and returns the resulting values. More...
|
|
static void | DisposeAll< T > (this IEnumerable< T > source) |
| Calls IDisposable.Dispose on all of the elements in the collection. More...
|
|
Extensions for the IEnumerable interface type.
◆ DisposeAll< T >()
static void VolumeControl.TypeExtensions.EnumerableExtensions.DisposeAll< T > |
( |
this IEnumerable< T > |
source | ) |
|
|
static |
Calls IDisposable.Dispose on all of the elements in the collection.
- Template Parameters
-
T | Enumerable element type that implements IDisposable. |
- Parameters
-
source | (implicit) The enumerable collection to dispose of. |
◆ ForEach< TSource >()
static void VolumeControl.TypeExtensions.EnumerableExtensions.ForEach< TSource > |
( |
this IEnumerable< TSource > |
source, |
|
|
Action< TSource > |
action |
|
) |
| |
|
static |
Performs the specified action on each source element.
◆ ForEach< TSource, TDiscardedResult >()
static void VolumeControl.TypeExtensions.EnumerableExtensions.ForEach< TSource, TDiscardedResult > |
( |
this IEnumerable< TSource > |
source, |
|
|
Func< TSource, TDiscardedResult > |
func |
|
) |
| |
|
static |
Performs the specified func on each source element, and discards the result.
- Template Parameters
-
TSource | The type of object contained by the source . |
TDiscardedResult | The type that is returned by the specified func . Returned values are ignored. |
◆ Select< TResult >()
static IEnumerable<TResult> VolumeControl.TypeExtensions.EnumerableExtensions.Select< TResult > |
( |
this IEnumerable |
source, |
|
|
Func< object, TResult > |
selector |
|
) |
| |
|
static |
Applies the specified selector to each element and returns the resulting values.
- Template Parameters
-
TResult | The type returned by the specified selector . |
- Parameters
-
source | An untyped enumerable instance to use as the source. |
selector | A selector method that accepts an untyped object and returns a TResult instance. |
- Returns
- The enumeration after applying the selector to each element.
◆ SelectIf< TSource, TResult >()
static IEnumerable<TResult> VolumeControl.TypeExtensions.EnumerableExtensions.SelectIf< TSource, TResult > |
( |
this IEnumerable< TSource > |
source, |
|
|
Func< TSource, TResult > |
selector, |
|
|
Func< TSource, bool > |
predicate |
|
) |
| |
|
static |
Does the same thing as the standard Linq Select() method, except this one uses a predicate and applies the selector only when the predicate returns true
.
- Template Parameters
-
- Parameters
-
source | |
selector | |
predicate | A predicate to apply to each item in source .
Return values are handled as follows:
true | Applies selector to the item, adding it to the returned enumerable. |
false | Skips the item, and does not apply the selector . |
|
- Returns
- Enumerable with values selected in the items of source by the selector , excluding those filtered out by predicate .
◆ SelectIfUnique< TSource, TResult >()
static IEnumerable<TResult> VolumeControl.TypeExtensions.EnumerableExtensions.SelectIfUnique< TSource, TResult > |
( |
this IEnumerable< TSource > |
source, |
|
|
Func< TSource, TResult > |
selector |
|
) |
| |
|
static |
Similar to the regular Select Linq method except that it only includes selected values that are unique.
- Template Parameters
-
TSource | Input Type |
TResult | Output Type |
- Parameters
-
source | Any enumerable TSource type. |
selector | A selector method. |
- Returns
- IEnumerable of type TResult , where each item is unique as determined by the generic Equals() method.
◆ SelectValues< TSource >()
static IEnumerable<TSource> VolumeControl.TypeExtensions.EnumerableExtensions.SelectValues< TSource > |
( |
this IEnumerable< TSource > |
source | ) |
|
|
static |
Selects non-null
values from the enumerable.
- Template Parameters
-
TSource | The type of element in the enumerable. |
- Returns
- The resulting elements that aren't
null
.
◆ SelectValues< TSource, TResult >()
static IEnumerable<TResult> VolumeControl.TypeExtensions.EnumerableExtensions.SelectValues< TSource, TResult > |
( |
this IEnumerable< TSource > |
source, |
|
|
Func< TSource, TResult?> |
selector |
|
) |
| |
|
static |
Selects non-null
values from the enumerable using the specified selector .
- Template Parameters
-
TSource | The type of element in the enumerable. |
TResult | The type of element in the resulting enumerable. |
- Parameters
-
source | The enumerable to apply the selector to. |
selector | A function that accepts a parameter of type TSource and returns a TResult instance, or null . When this returns null the item does not appear in the resulting enumeration. |
- Returns
- The resulting elements of type TResult that aren't
null
.
The documentation for this class was generated from the following file: