    

 ## On this page

  

 

 # Class InheritableHashSet&lt;T\\&gt;

 Last update: 16.07.2025 

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

```csharp
public abstract class InheritableHashSet<T> : HashSet<T>

```

#### Type Parameters

`T`

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ← [HashSet&lt;T&gt;](https://learn.microsoft.com/dotnet/api/system.collections.generic.hashset-1) ← [InheritableHashSet&lt;T&gt;](VM.Collections.InheritableHashSet-1.md)

## Constructors

### InheritableHashSet()

```csharp
public InheritableHashSet()

```

### InheritableHashSet(IEnumerable&lt;T&gt;)

```csharp
public InheritableHashSet(IEnumerable<T> collection)

```

#### Parameters

`collection` [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;T&gt;

### InheritableHashSet(IEqualityComparer&lt;T&gt;)

```csharp
public InheritableHashSet(IEqualityComparer<T> comparer)

```

#### Parameters

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

### InheritableHashSet(IEnumerable&lt;T&gt;, IEqualityComparer&lt;T&gt;)

```csharp
public InheritableHashSet(IEnumerable<T> collection, IEqualityComparer<T> comparer)

```

#### Parameters

`collection` [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;T&gt;

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

### InheritableHashSet(SerializationInfo, StreamingContext)

```csharp
protected InheritableHashSet(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)

## Methods

### Add(T)

```csharp
public bool Add(T item)

```

#### Parameters

`item` T

#### Returns

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

### AddItem(T)

```csharp
protected virtual bool AddItem(T item)

```

#### Parameters

`item` T

#### Returns

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

### Clear()

```csharp
public void Clear()

```

### ClearItems()

```csharp
protected virtual void ClearItems()

```

### Remove(T)

```csharp
public bool Remove(T item)

```

#### Parameters

`item` T

#### Returns

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

### RemoveItem(T)

```csharp
protected virtual bool RemoveItem(T item)

```

#### Parameters

`item` T

#### Returns

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