> 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.unity/ks.unity.ksiserializabledictionary.md).

# Interface ksISerializableDictionary

Namespace: [KS.Unity](/reactor/api-reference/ks.unity.md)\
Assembly: KSUnity.dll

Extends the IDictionary interface with functions used by the dictionary property drawer to detect duplicate keys. Because the contents of the dictionary are serialized in a list, it is possible for the list to contain duplicate keys.

```csharp
public interface ksISerializableDictionary : IDictionary, ICollection, IEnumerable, ISerializationCallbackReceiver
```

#### Implements

[IDictionary](https://learn.microsoft.com/dotnet/api/system.collections.idictionary), [ICollection](https://learn.microsoft.com/dotnet/api/system.collections.icollection), [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.ienumerable), ISerializationCallbackReceiver

## Methods

### HasDuplicateKeys() <a href="#ks_unity_ksiserializabledictionary_hasduplicatekeys" id="ks_unity_ksiserializabledictionary_hasduplicatekeys"></a>

Checks if there are any duplicate keys.

```csharp
bool HasDuplicateKeys()
```

#### Returns

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

True if there are any duplicate keys.

### HasNullKeys() <a href="#ks_unity_ksiserializabledictionary_hasnullkeys" id="ks_unity_ksiserializabledictionary_hasnullkeys"></a>

Checks if there are any null keys.

```csharp
bool HasNullKeys()
```

#### Returns

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

True if there are any null keys.

### IsNullOrDuplicateKeyAt(int) <a href="#ks_unity_ksiserializabledictionary_isnullorduplicatekeyat_system_int32" id="ks_unity_ksiserializabledictionary_isnullorduplicatekeyat_system_int32"></a>

Checks if the key at the `index` is null or a duplicate.

```csharp
bool IsNullOrDuplicateKeyAt(int index)
```

#### Parameters

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

Index to check.

#### Returns

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

True if the key at the `index` is null or a duplicate.
