Class SetExtensions
- Namespace
- CarinaStudio.Collections
- Assembly
- CarinaStudio.AppBase.Core.dll
Extensions for ISet<T>.
public static class SetExtensions
- Inheritance
-
SetExtensions
- Inherited Members
Methods
AddAll<T>(ISet<T>, IEnumerable<T>)
Add all given elements to the set.
public static void AddAll<T>(this ISet<T> set, IEnumerable<T> elements)
Parameters
set
ISet<T>elements
IEnumerable<T>Elements to add.
Type Parameters
T
Type of element.
AsReadOnly<T>(ISet<T>)
Make ISet<T> as read-only.
public static ISet<T> AsReadOnly<T>(this ISet<T> set)
Parameters
Returns
Type Parameters
T
Type of element.
IsEmpty<T>(HashSet<T>)
Check whether the given set is empty or not.
public static bool IsEmpty<T>(this HashSet<T> set)
Parameters
set
HashSet<T>Set to check.
Returns
- bool
True if the set is empty.
Type Parameters
T
Type of element of set.
Remarks
The method is available for target framework before .NET 9.
IsEmpty<T>(ISet<T>)
Check whether the given set is empty or not.
public static bool IsEmpty<T>(this ISet<T> set)
Parameters
set
ISet<T>Set to check.
Returns
- bool
True if the set is empty.
Type Parameters
T
Type of element of set.
Remarks
The method is available for target framework before .NET 9.
IsEmpty<T>(SortedSet<T>)
Check whether the given set is empty or not.
public static bool IsEmpty<T>(this SortedSet<T> set)
Parameters
set
SortedSet<T>Set to check.
Returns
- bool
True if the set is empty.
Type Parameters
T
Type of element of set.
Remarks
The method is available for target framework before .NET 9.
IsNotEmpty<T>(HashSet<T>?)
Check whether the given set is not empty or not.
public static bool IsNotEmpty<T>(this HashSet<T>? set)
Parameters
set
HashSet<T>Set to check.
Returns
- bool
True if the set is not empty.
Type Parameters
T
Type of element of set.
Remarks
The method is available for target framework before .NET 9.
IsNotEmpty<T>(ISet<T>?)
Check whether the given set is not empty or not.
public static bool IsNotEmpty<T>(this ISet<T>? set)
Parameters
set
ISet<T>Set to check.
Returns
- bool
True if the set is not empty.
Type Parameters
T
Type of element of set.
Remarks
The method is available for target framework before .NET 9.
IsNotEmpty<T>(SortedSet<T>?)
Check whether the given set is not empty or not.
public static bool IsNotEmpty<T>(this SortedSet<T>? set)
Parameters
set
SortedSet<T>Set to check.
Returns
- bool
True if the set is not empty.
Type Parameters
T
Type of element of set.
Remarks
The method is available for target framework before .NET 9.
IsNullOrEmpty<T>(HashSet<T>?)
Check whether given set is null/empty or not.
public static bool IsNullOrEmpty<T>(this HashSet<T>? set)
Parameters
set
HashSet<T>Set to check.
Returns
- bool
True if the set is null or empty.
Type Parameters
T
Type of element of set.
Remarks
The method is available for target framework before .NET 9.
IsNullOrEmpty<T>(ISet<T>?)
Check whether given set is null/empty or not.
public static bool IsNullOrEmpty<T>(this ISet<T>? set)
Parameters
set
ISet<T>Set to check.
Returns
- bool
True if the set is null or empty.
Type Parameters
T
Type of element of set.
Remarks
The method is available for target framework before .NET 9.
IsNullOrEmpty<T>(SortedSet<T>?)
Check whether given set is null/empty or not.
public static bool IsNullOrEmpty<T>(this SortedSet<T>? set)
Parameters
set
SortedSet<T>Set to check.
Returns
- bool
True if the set is null or empty.
Type Parameters
T
Type of element of set.
Remarks
The method is available for target framework before .NET 9.