Version 3.3.1.2

ImmutableList class

Namespace: Sirenix.Utilities
Assembly: Sirenix.Utilities
public sealed class ImmutableList : IImmutableList<object>, IImmutableList, IList, ICollection, IList<object>, ICollection<object>, IEnumerable<object>, IEnumerable
Immutable list wraps another list, and allows for reading the inner list, without the ability to change it.
Inheritance
  • System.Object
  • ImmutableList

Constructors

ImmutableList(IList)
Creates an immutable list around another list.
public ImmutableList(IList innerList)
Parameters
System.Collections.IList innerList

Properties

Count
Number of items in the list.
public int Count { get; }
IsFixedSize
Immutable list cannot be changed directly, so it's size is always fixed.
public bool IsFixedSize { get; }
IsReadOnly
Immutable list are always readonly.
public bool IsReadOnly { get; }
IsSynchronized
Returns true if the inner list is synchronized.
public bool IsSynchronized { get; }
Item[Int32]
Index accessor.
public object this[int index] { get; }
Parameters
System.Int32 index

Index.

SyncRoot
Gets the sync root object.
public object SyncRoot { get; }

Methods

Contains(Object)
Returns true if the item is contained in the list.
public bool Contains(object value)
Parameters
System.Object value

The item's value.

Returns
System.Boolean

CopyTo(Array, Int32)
Copy the list to an array,
public void CopyTo(Array array, int index)
Parameters
System.Array array

Target array.

System.Int32 index

Index.

CopyTo(Object[], Int32)
Copy the list to an array,
public void CopyTo(object[] array, int arrayIndex)
Parameters
System.Object[] array

Target array.

System.Int32 arrayIndex

Index.

GetEnumerator()
Gets an enumerator.
public IEnumerator GetEnumerator()
Returns
System.Collections.IEnumerator

IndexOf(Object)
Get the index of a value.
public int IndexOf(object value)
Parameters
System.Object value

The item's value.

Returns
System.Int32

Extension Methods