# EntriesAttribute

Kind: Class · Namespace: Sansar.Script · Assembly: Sansar.Script.dll · Script API 47.10.0

<div class="api-meta">
<span class="api-kind api-kind-class" data-pagefind-filter="kind:Class">Class</span>
<span data-pagefind-filter="namespace:Sansar.Script">Namespace <a href="/scripting/api/sansar.script"><code>Sansar.Script</code></a></span>
<span>Inherits <a href="https://learn.microsoft.com/dotnet/api/system.attribute">Attribute</a></span>
</div>

<span id="T:Sansar.Script.EntriesAttribute"></span>

List of entries to populate IList or IDictionary properties with.

```csharp
[System.AttributeUsage(System.AttributeTargets.Field)]
public class EntriesAttribute : Attribute
```

## Remarks

When used with IDictionary the entries are the keys with no default values.

## Members at a glance

| Kind | Members |
|---|---|
| **Constructors** | [EntriesAttribute](#entriesattribute) |
| **Fields** | [Locked](#locked) |

## Constructors

### EntriesAttribute

<div class="api-card">
<span id="M:Sansar.Script.EntriesAttribute.#ctor(System.Object[])"></span>
<span id="C:Sansar.Script.EntriesAttribute(System.Object[])"></span>

```csharp signature
public EntriesAttribute(params object[] entries)
```

List of entries to populate IList or IDictionary properties with.

| Parameter | Type | Description |
|---|---|---|
| `entries` | [object](https://learn.microsoft.com/dotnet/api/system.object)\[\] |  |

<details class="api-remarks"><summary>Remarks</summary>

When used with IDictionary the entries are the keys with no default values.



When used with IList the entries are the default values.

To set an IList of a specific Count with no default values use [`MinEntriesAttribute`](/scripting/api/sansar.script/minentriesattribute)

Has no effect on other parameter types.

For [`Vector`](/scripting/api/sansar/vector), [`Quaternion`](/scripting/api/sansar/quaternion), and [`Color`](/scripting/api/sansar/color)s in IList their default values must be specified in string form.

</details>

<details class="api-example" open><summary>Example</summary>

```csharp
[Entries("King", "Queen", "Rook", "Bishop", "Knight", "Pawn")]
public IDictionary<string, ClusterResource> GamePieces;

[Entries("<1,2,3>", "<2.5,3.6,4.6>")]
public IList<Sansar.Vector> GamePieces;
```

</details>

</div>


## Fields

### Locked

<div class="api-card">
<span id="F:Sansar.Script.EntriesAttribute.Locked"></span>

```csharp signature
public bool Locked
```

Locks the IDictionary or IList properties so entries can not be added or removed.

</div>




<p class="api-generated" data-pagefind-ignore>Generated from the Sansar 47.10.0 client ScriptApi snapshot.</p>