Click or drag to resize
AlgorithmsReadWriteListT Method

Creates a read-write IList<T> wrapper around an array. When an array is implicitely converted to an IList<T>, changes to the items in the array cannot be made through the interface. This method creates a read-write IList<T> wrapper on an array that can be used to make changes to the array.

Use this method when you need to pass an array to an algorithms that takes an IList<T> and that tries to modify items in the list. Algorithms in this class generally do not need this method, since they have been design to operate on arrays even when they are passed as an IList<T>.

Namespace: X3Platform.Collections
Assembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntax
public static IList<T> ReadWriteList<T>(
	T[] array
)

Parameters

array
Type: T
The array to wrap.

Type Parameters

T

[Missing <typeparam name="T"/> documentation for "M:X3Platform.Collections.Algorithms.ReadWriteList``1(``0[])"]

Return Value

Type: IListT
An IList<T> wrapper onto array.
Remarks
Since arrays cannot be resized, inserting an item causes the last item in the array to be automatically removed. Removing an item causes the last item in the array to be replaced with a default value (0 or null). Clearing the list causes all the items to be replaced with a default value.
See Also