Show / Hide Table of Contents

Class ICollectionExtensions

Extension methods for ICollection<T>.

Inheritance
object
ICollectionExtensions
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Phoenix.BotBrain.Extensions
Assembly: Phoenix.Plugin.BotBrain.Lists.dll
Syntax
public static class ICollectionExtensions

Methods

View Source

GetNearestIndex(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.

View Source

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.

  • View Source
In this article
Back to top Generated by DocFX