Class EnumerationExtensions
Inheritance
System.Object
EnumerationExtensions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: Common.dll
Syntax
public static class EnumerationExtensions
Methods
Add<T>(Enum, T)
Declaration
public static T Add<T>(this Enum type, T value)
Parameters
Type |
Name |
Description |
System.Enum |
type |
|
T |
value |
|
Returns
Type Parameters
Has<T>(Enum, T)
Checks if the value contains the provided type.
It is NOT
validated whether type.GetType() == typeof(T). Only the respective int-casts are compared!
Declaration
public static bool Has<T>(this Enum type, T value)
Parameters
Type |
Name |
Description |
System.Enum |
type |
The extended System.Enum.
|
T |
value |
The flag to check for.
|
Returns
Type |
Description |
System.Boolean |
True, if the -flag is set in the -Enum.
It is NOT validated whether type.GetType() == typeof(T). Only the respective int-casts are compared!
|
Type Parameters
Name |
Description |
T |
The flag enum type, that you want to check against.
|
Is<T>(Enum, T)
Declaration
public static bool Is<T>(this Enum type, T value)
Parameters
Type |
Name |
Description |
System.Enum |
type |
|
T |
value |
|
Returns
Type |
Description |
System.Boolean |
|
Type Parameters
Remove<T>(Enum, T)
Declaration
public static T Remove<T>(this Enum type, T value)
Parameters
Type |
Name |
Description |
System.Enum |
type |
|
T |
value |
|
Returns
Type Parameters
SelectWhere<TSource, TResult>(IEnumerable<TSource>, Func<TSource, TResult>, Func<TSource, Boolean>)
Adds a filter to System.Linq.Enumerable.Select``2(System.Collections.Generic.IEnumerable{``0},System.Func{``0,``1}) calls.
Declaration
public static IEnumerable<TResult> SelectWhere<TSource, TResult>(this IEnumerable<TSource> enumerable, Func<TSource, TResult> selector, Func<TSource, bool> filter)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<TSource> |
enumerable |
The enumerable.
|
System.Func<TSource, TResult> |
selector |
The selector to transfer TSource to TResult .
|
System.Func<TSource, System.Boolean> |
filter |
The where-filter.
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<TResult> |
|
Type Parameters
Name |
Description |
TSource |
The source type.
|
TResult |
The result type.
|
ToHashSet<T>(IEnumerable<T>, IEqualityComparer<T>)
Returns a hashset that contains the elements from enumerable
.
Declaration
public static HashSet<T> ToHashSet<T>(this IEnumerable<T> enumerable, IEqualityComparer<T> comparer = null)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<T> |
enumerable |
The enumerable
|
System.Collections.Generic.IEqualityComparer<T> |
comparer |
Optional: The equality comparer.
|
Returns
Type |
Description |
System.Collections.Generic.HashSet<T> |
The hash set.
|
Type Parameters
Name |
Description |
T |
The type.
|