    

 ## On this page

  

 

 # Class InheritableDictionary&lt;TKey, TValue\\&gt;

 Last update: 16.07.2025 

Namespace: [VM.Collections](VM.Collections.md)  
Assembly: VM.dll

```csharp
public abstract class InheritableDictionary<TKey, TValue> : Dictionary<TKey, TValue>

```

#### Type Parameters

`TKey`

`TValue`

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ← [Dictionary&lt;TKey, TValue&gt;](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary-2) ← [InheritableDictionary&lt;TKey, TValue&gt;](VM.Collections.InheritableDictionary-2.md)

## Constructors

### InheritableDictionary()

```csharp
public InheritableDictionary()

```

### InheritableDictionary(int)

```csharp
public InheritableDictionary(int capacity)

```

#### Parameters

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

### InheritableDictionary(IEqualityComparer&lt;TKey&gt;)

```csharp
public InheritableDictionary(IEqualityComparer<TKey> comparer)

```

#### Parameters

`comparer` [IEqualityComparer](https://learn.microsoft.com/dotnet/api/system.collections.generic.iequalitycomparer-1)&lt;TKey&gt;

### InheritableDictionary(int, IEqualityComparer&lt;TKey&gt;)

```csharp
public InheritableDictionary(int capacity, IEqualityComparer<TKey> comparer)

```

#### Parameters

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

`comparer` [IEqualityComparer](https://learn.microsoft.com/dotnet/api/system.collections.generic.iequalitycomparer-1)&lt;TKey&gt;

### InheritableDictionary(IDictionary&lt;TKey, TValue&gt;)

```csharp
public InheritableDictionary(IDictionary<TKey, TValue> dictionary)

```

#### Parameters

`dictionary` [IDictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.idictionary-2)&lt;TKey, TValue&gt;

### InheritableDictionary(IDictionary&lt;TKey, TValue&gt;, IEqualityComparer&lt;TKey&gt;)

```csharp
public InheritableDictionary(IDictionary<TKey, TValue> dictionary, IEqualityComparer<TKey> comparer)

```

#### Parameters

`dictionary` [IDictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.idictionary-2)&lt;TKey, TValue&gt;

`comparer` [IEqualityComparer](https://learn.microsoft.com/dotnet/api/system.collections.generic.iequalitycomparer-1)&lt;TKey&gt;

### InheritableDictionary(SerializationInfo, StreamingContext)

```csharp
protected InheritableDictionary(SerializationInfo serializationInfo, StreamingContext streamingContext)

```

#### Parameters

`serializationInfo` [SerializationInfo](https://learn.microsoft.com/dotnet/api/system.runtime.serialization.serializationinfo)

`streamingContext` [StreamingContext](https://learn.microsoft.com/dotnet/api/system.runtime.serialization.streamingcontext)

## Properties

### this\[TKey\]

```csharp
public TValue this[TKey key] { get; set; }

```

#### Property Value

TValue

## Methods

### Add(TKey, TValue)

```csharp
public void Add(TKey key, TValue value)

```

#### Parameters

`key` TKey

`value` TValue

### AddItem(TKey, TValue)

```csharp
protected virtual void AddItem(TKey key, TValue value)

```

#### Parameters

`key` TKey

`value` TValue

### Clear()

```csharp
public void Clear()

```

### ClearItems()

```csharp
protected virtual void ClearItems()

```

### Remove(TKey)

```csharp
public bool Remove(TKey key)

```

#### Parameters

`key` TKey

#### Returns

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

### RemoveItem(TKey)

```csharp
protected virtual bool RemoveItem(TKey key)

```

#### Parameters

`key` TKey

#### Returns

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