Class ICollectionExtensions
Extension methods for ICollection<T>.
Inherited Members
Namespace: Phoenix.BotBrain.Extensions
Assembly: Phoenix.Plugin.BotBrain.Lists.dll
Syntax
public static class ICollectionExtensions
Methods
View SourceGetNearestIndex(ICollection, int)
Clamps a number to a valid index in a collection, or null if it is empty.
Declaration
public static int? GetNearestIndex(this ICollection self, int value)
Parameters
| Type | Name | Description |
|---|---|---|
| ICollection | self | The collection being extended. |
| int | value | The number. |
Returns
| Type | Description |
|---|---|
| int? | the index. |
GetNearestIndex<T>(ICollection<T>, int)
Clamps a number to a valid index in a collection, or null if it is empty.
Declaration
public static int? GetNearestIndex<T>(this ICollection<T> self, int value)
Parameters
| Type | Name | Description |
|---|---|---|
| ICollection<T> | self | The collection being extended. |
| int | value | The number. |
Returns
| Type | Description |
|---|---|
| int? | the index. |
Type Parameters
| Name | Description |
|---|---|
| T | The item type. |