> For the complete documentation index, see [llms.txt](https://kinematicsoup.gitbook.io/reactor/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kinematicsoup.gitbook.io/reactor/api-reference/ks.reactor/ks.reactor.ksmultilist-1.md).

# Class ksMultiList\<T>

Namespace: [KS.Reactor](/reactor/api-reference/ks.reactor.md)\
Assembly: KSCommon.dll

Wraps multiple lists and presents them as one list with read-only access.

```csharp
public class ksMultiList<T> : IEnumerable<T>, IEnumerable
```

#### Type Parameters

`T`

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) â† [ksMultiList\<T>](/reactor/api-reference/ks.reactor/ks.reactor.ksmultilist-1.md)

#### Implements

[IEnumerable\<T>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1), [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.ienumerable)

#### Inherited Members

[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object\)), [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object-system-object\)), [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype), [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Constructors

### ksMultiList(params IList\<T>\[]) <a href="#ks_reactor_ksmultilist_1__ctor_system_collections_generic_ilist__0" id="ks_reactor_ksmultilist_1__ctor_system_collections_generic_ilist__0"></a>

Constructor

```csharp
public ksMultiList(params IList<T>[] lists)
```

#### Parameters

`lists` [IList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ilist-1)\<T>\[]

The lists to wrap and present as one list.

## Properties

### Count <a href="#ks_reactor_ksmultilist_1_count" id="ks_reactor_ksmultilist_1_count"></a>

The combined number of items in all lists.

```csharp
public int Count { get; }
```

#### Property Value

[int](https://learn.microsoft.com/dotnet/api/system.int32)

### this\[int] <a href="#ks_reactor_ksmultilist_1_item_system_int32" id="ks_reactor_ksmultilist_1_item_system_int32"></a>

Gets the item at an index. The inner lists are treated as one continuous list, so if there are two lists and the first list has 3 items, index 3 will be the first item in the second list.

```csharp
public T this[int index] { get; }
```

#### Property Value

T

## Methods

### Contains(T) <a href="#ks_reactor_ksmultilist_1_contains__0" id="ks_reactor_ksmultilist_1_contains__0"></a>

Checks if an item is contained in any of the inner lists.

```csharp
public bool Contains(T item)
```

#### Parameters

`item` T

Item to check for.

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

True if the item is in any of the inner lists.

### CopyTo(T\[], int) <a href="#ks_reactor_ksmultilist_1_copyto__0___system_int32" id="ks_reactor_ksmultilist_1_copyto__0___system_int32"></a>

Copies the contents of each list to an array.

```csharp
public void CopyTo(T[] array, int arrayIndex)
```

#### Parameters

`array` T\[]

Array to copy to.

`arrayIndex` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Array index to start copying to.

### GetEnumerator() <a href="#ks_reactor_ksmultilist_1_getenumerator" id="ks_reactor_ksmultilist_1_getenumerator"></a>

Enumerates all the lists.

```csharp
public IEnumerator<T> GetEnumerator()
```

#### Returns

[IEnumerator](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerator-1)\<T>

Enumerator for all the lists.

### IndexOf(T) <a href="#ks_reactor_ksmultilist_1_indexof__0" id="ks_reactor_ksmultilist_1_indexof__0"></a>

Gets the index of an item in the multi list. See [Item](/reactor/api-reference/ks.reactor.md#KS_Reactor_ksMultiList_601_Item_System_Int32_) for indexing rules.

```csharp
public int IndexOf(T item)
```

#### Parameters

`item` T

Item to get index of.

#### Returns

[int](https://learn.microsoft.com/dotnet/api/system.int32)

The index of the item, or -1 if the item was not found.
