Class GorgonNamedObjectDictionary<T>
A dictionary to contain IGorgonNamedObject types.
Inherited Members
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 SourceGorgonNamedObjectDictionary(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 Sourcethis[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 SourceAdd(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. |
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. |
Clear()
Function to clear the items from the list.
Declaration
public void Clear()
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 |
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. |