Version 2.1.0.0

ListExtensions class

Namespace: Sirenix.Utilities
Assembly: Sirenix.Utilities
public static class ListExtensions
Various list extension methods.
Inheritance
  • System.Object
  • ListExtensions

Methods

SetLength<T>(IList<T>, Int32)
Increases or decrease the number of items in the list to the specified count.
public static void SetLength<T>(this IList<T> list, int length)
Parameters
System.Collections.Generic.IList<T> list

The list.

System.Int32 length

The new length.

Type Parameters
T

SetLength<T>(IList<T>, Int32, Func<T>)
Increases or decrease the number of items in the list to the specified count.
public static void SetLength<T>(this IList<T> list, int length, Func<T> newElement)
Parameters
System.Collections.Generic.IList<T> list

The list.

System.Int32 length

The new length.

System.Func<T> newElement

Value of new elements.

Type Parameters
T

SetLength<T>(ref IList<T>, Int32)
Increases or decrease the number of items in the list to the specified count.
public static void SetLength<T>(ref IList<T> list, int length)
Parameters
System.Collections.Generic.IList<T> list

The list.

System.Int32 length

The new length.

Type Parameters
T

SetLength<T>(ref IList<T>, Int32, Func<T>)
Increases or decrease the number of items in the list to the specified count.
public static void SetLength<T>(ref IList<T> list, int length, Func<T> newElement)
Parameters
System.Collections.Generic.IList<T> list

The list.

System.Int32 length

The new length.

System.Func<T> newElement

Value of new elements.

Type Parameters
T