Gorgon
Show / Hide Table of Contents

Class GorgonNamedObjectDictionary<T>

A dictionary to contain IGorgonNamedObject types.

Inheritance
object
GorgonBaseNamedObjectDictionary<T>
GorgonNamedObjectDictionary<T>
Implements
IGorgonNamedObjectDictionary<T>
ICollection<T>
IGorgonNamedObjectReadOnlyDictionary<T>
IReadOnlyCollection<T>
IEnumerable<T>
IEnumerable
Inherited Members
GorgonBaseNamedObjectDictionary<T>.Items
GorgonBaseNamedObjectDictionary<T>.KeysAreCaseSensitive
GorgonBaseNamedObjectDictionary<T>.AddItems(IEnumerable<T>)
GorgonBaseNamedObjectDictionary<T>.UpdateItem(string, T)
GorgonBaseNamedObjectDictionary<T>.RemoveItem(T)
GorgonBaseNamedObjectDictionary<T>.Contains(string)
GorgonBaseNamedObjectDictionary<T>.Contains(T)
GorgonBaseNamedObjectDictionary<T>.TryGetValue(string, out T)
GorgonBaseNamedObjectDictionary<T>.GetEnumerator()
GorgonBaseNamedObjectDictionary<T>.Count
GorgonBaseNamedObjectDictionary<T>.CopyTo(T[], int)
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: Gorgon.Collections.Specialized
Assembly: Gorgon.Core.dll
Syntax
public class GorgonNamedObjectDictionary<T> : GorgonBaseNamedObjectDictionary<T>, IGorgonNamedObjectDictionary<T>, ICollection<T>, IGorgonNamedObjectReadOnlyDictionary<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable where T : IGorgonNamedObject
Type Parameters
Name Description
T

The type of object to store in the list. Must implement the IGorgonNamedObject interface.

Remarks

This is a concrete implementation of the GorgonBaseNamedObjectDictionary<T> type.

This collection is not thread safe.

Constructors

| Edit this page View Source

GorgonNamedObjectDictionary(bool)

Initializes a new instance of the GorgonNamedObjectDictionary<T> class.

Declaration
public GorgonNamedObjectDictionary(bool caseSensitive = true)
Parameters
Type Name Description
bool caseSensitive

[Optional] true to use case sensitive keys, false to ignore casing.

Properties

| Edit this page View Source

this[string]

Property to return an item in this list by name.

Declaration
public T this[string name] { get; set; }
Parameters
Type Name Description
string name
Property Value
Type Description
T

Methods

| Edit this page View Source

Add(T)

Function to add an item to the list.

Declaration
public void Add(T item)
Parameters
Type Name Description
T item

Item to add to the list.

| Edit this page View Source

AddRange(IEnumerable<T>)

Function to add a list of items to this list.

Declaration
public void AddRange(IEnumerable<T> items)
Parameters
Type Name Description
IEnumerable<T> items

The items to add to this list.

| Edit this page View Source

Clear()

Function to clear the items from the list.

Declaration
public void Clear()
| Edit this page View Source

Remove(string)

Function to remove an item with the specified name from this list.

Declaration
public void Remove(string name)
Parameters
Type Name Description
string name

Name of the item to remove.

Exceptions
Type Condition
KeyNotFoundException

Thrown when no item with the specified name can be found.

| Edit this page View Source

Remove(T)

Function to remove an item from this list.

Declaration
public void Remove(T item)
Parameters
Type Name Description
T item

Item to remove from the list.

Implements

IGorgonNamedObjectDictionary<T>
ICollection<T>
IGorgonNamedObjectReadOnlyDictionary<T>
IReadOnlyCollection<T>
IEnumerable<T>
IEnumerable

Extension Methods

GorgonDebugExtensions.ValidateObject<T>(T, string)
GorgonTreeLinqExtensions.TraverseDepthFirst<T>(IEnumerable<T>, Func<T, IEnumerable<T>>)
GorgonTreeLinqExtensions.Traverse<T>(IEnumerable<T>, Func<T, IEnumerable<T>>)
GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author