Class CollectionExtensions
Inheritance
System.Object
CollectionExtensions
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()
Namespace: PiXYZ.Utils
Assembly: cs.temp.dll.dll
Syntax
public static class CollectionExtensions
Methods
Append<T>(ref T[], T)
Adds an item at the end of a given array, resizing the array to fit it.
Declaration
public static void Append<T>(ref T[] array, T item)
Parameters
Type | Name | Description |
---|---|---|
T[] | array | Array |
T | item | Item to append |
Type Parameters
Name | Description |
---|---|
T | Array element type |
Append<T>(ref T[], T[])
Adds items at the end of a given array, resizing the array to fit it.
Declaration
public static void Append<T>(ref T[] array1, T[] array2)
Parameters
Type | Name | Description |
---|---|---|
T[] | array1 | Array |
T[] | array2 | Array to append |
Type Parameters
Name | Description |
---|---|
T |
CreateArrayFromArrays<T>(T[][])
Create an array by concatenating several arrays one after another.
Declaration
public static T[] CreateArrayFromArrays<T>(params T[][] arrays)
Parameters
Type | Name | Description |
---|---|---|
T[][] | arrays | Source arrays |
Returns
Type | Description |
---|---|
T[] |
Type Parameters
Name | Description |
---|---|
T |
Insert<T>(ref T[], T, Int32)
Insert element in array at given index. Previous element at index is moved to index + 1.
Declaration
public static void Insert<T>(ref T[] array, T item, int index)
Parameters
Type | Name | Description |
---|---|---|
T[] | array | |
T | item | |
System.Int32 | index |
Type Parameters
Name | Description |
---|---|
T |
RemoveAt<T>(ref T[], Int32)
Remove array element at given index.
Declaration
public static void RemoveAt<T>(ref T[] array, int index)
Parameters
Type | Name | Description |
---|---|---|
T[] | array | |
System.Int32 | index |
Type Parameters
Name | Description |
---|---|
T |
Resize(Array, Int32)
Resizes a base Array. Difference with the Array.Resize is that this method works also on Array base class without any casting.
Declaration
public static Array Resize(this Array oldArray, int newSize)
Parameters
Type | Name | Description |
---|---|---|
System.Array | oldArray | |
System.Int32 | newSize |
Returns
Type | Description |
---|---|
System.Array |
ToEnumerable<T>(IEnumerator)
Transforms an IEnumerator to an IEnumerable to given type.
Declaration
public static IEnumerable<T> ToEnumerable<T>(this IEnumerator enumerator)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerator | enumerator |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> |
Type Parameters
Name | Description |
---|---|
T |