Interface IGorgonNamedObjectDictionary<T>
A generic interface for a dictionary of named objects that can be indexed by name.
Inherited Members
Namespace: Gorgon.Collections
Assembly: Gorgon.Core.dll
Syntax
public interface IGorgonNamedObjectDictionary<T> : ICollection<T>, IEnumerable<T>, IEnumerable where T : IGorgonNamedObject
Type Parameters
Name | Description |
---|---|
T | The type of object to store in the collection. Must implement the IGorgonNamedObject interface. |
Properties
| Edit this page View Sourcethis[string]
Property to set or return an item in the dictionary by its name.
Declaration
T this[string name] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
string | name |
Property Value
Type | Description |
---|---|
T |
KeysAreCaseSensitive
Property to return whether the keys are case sensitive.
Declaration
bool KeysAreCaseSensitive { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
| Edit this page View SourceContains(string)
Function to return whether an item with the specified name exists in this collection.
Declaration
bool Contains(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | Name of the item to find. |
Returns
Type | Description |
---|---|
bool | trueif found, false if not. |
Remove(string)
Function to remove an item by its name.
Declaration
void Remove(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the object to remove. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
ArgumentEmptyException | Thrown when the |
KeyNotFoundException | Thrown when no item with the name specified could be found in the dictionary. |
TryGetValue(string, out T)
Function to return an item from the collection.
Declaration
bool TryGetValue(string name, out T value)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the item to look up. |
T | value | The item, if found, or the default value for the type if not. |
Returns
Type | Description |
---|---|
bool | true if the item was found, false if not. |