Interface IGorgonNamedObjectList<T>
A generic interface for a list of named objects that can be indexed by name and numeric index.
Inherited Members
Namespace: Gorgon.Collections
Assembly: Gorgon.Core.dll
Syntax
public interface IGorgonNamedObjectList<T> : IList<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 return an item within this list by its name.
Declaration
T this[string name] { get; }
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 SourceAddRange(IEnumerable<T>)
Function to add a list of items to the list.
Declaration
void AddRange(IEnumerable<T> items)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | items | Items to add to the list. |
Contains(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 | true if found, false if not. |
IndexOf(string)
Determines the index of a specific item in the list.
Declaration
int IndexOf(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | Name of the item to find. |
Returns
Type | Description |
---|---|
int | The index of |
Remove(int)
Function to remove an item by its index.
Declaration
void Remove(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index | The index of the item to remove. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | Thrown when the |
Remove(string)
Function to remove an item with the specified name from this list.
Declaration
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 |