# ToList

> Adds all elements satisfying selection rules to the list.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.UIElements](/engine/6000.6/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule

## ToList(List\<T>)

Adds all elements satisfying selection rules to the list.

```csharp
public void ToList(List<T> results)
```

### Parameters

**** (\[List\<T>]\(https\://learn.microsoft.com/dotnet/api/system.collections.generic.list-1)): Adds all elements satisfying selection rules to the list.

## ToList()

Returns a list containing elements satisfying selection rules.

```csharp
public List<T> ToList()
```

### Returns

| Type                                                                                 | Description                                            |
| ------------------------------------------------------------------------------------ | ------------------------------------------------------ |
| [List\<T>](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1) | A list containing elements satisfying selection rules. |
