Gorgon
Show / Hide Table of Contents

Class GorgonNamedObjectList<T>

A list to contain IGorgonNamedObject types.

Inheritance
object
GorgonBaseNamedObjectList<T>
GorgonNamedObjectList<T>
GorgonOptionBag
Implements
IGorgonNamedObjectList<T>
IList<T>
ICollection<T>
IGorgonNamedObjectReadOnlyList<T>
IReadOnlyList<T>
IReadOnlyCollection<T>
IEnumerable<T>
IEnumerable
Inherited Members
GorgonBaseNamedObjectList<T>.Items
GorgonBaseNamedObjectList<T>.KeysAreCaseSensitive
GorgonBaseNamedObjectList<T>.GetItemByName(string)
GorgonBaseNamedObjectList<T>.AddItems(IEnumerable<T>)
GorgonBaseNamedObjectList<T>.InsertItems(int, IEnumerable<T>)
GorgonBaseNamedObjectList<T>.RemoveItemByName(string)
GorgonBaseNamedObjectList<T>.Contains(string)
GorgonBaseNamedObjectList<T>.IndexOf(string)
GorgonBaseNamedObjectList<T>.IndexOf(T)
GorgonBaseNamedObjectList<T>.Count
GorgonBaseNamedObjectList<T>.Contains(T)
GorgonBaseNamedObjectList<T>.CopyTo(T[], int)
GorgonBaseNamedObjectList<T>.GetEnumerator()
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 GorgonNamedObjectList<T> : GorgonBaseNamedObjectList<T>, IGorgonNamedObjectList<T>, IList<T>, ICollection<T>, IGorgonNamedObjectReadOnlyList<T>, IReadOnlyList<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 GorgonBaseNamedObjectList<T> type.

This collection is not thread safe.

Constructors

| Edit this page View Source

GorgonNamedObjectList(bool)

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

Declaration
public GorgonNamedObjectList(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[int]

Property to set or return an item in this list by index.

Declaration
public T this[int index] { get; set; }
Parameters
Type Name Description
int index
Property Value
Type Description
T
| Edit this page View Source

this[string]

Property to return an item in this list by name.

Declaration
public T this[string name] { get; }
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

Insert(int, T)

Function to insert an item in the list at the specified index.

Declaration
public void Insert(int index, T item)
Parameters
Type Name Description
int index

Index to insert at.

T item

Item to insert.

Exceptions
Type Condition
ArgumentOutOfRangeException

Thrown when the index is less than 0.

| Edit this page View Source

InsertRange(int, IEnumerable<T>)

Function to insert a list of items at the specified index.

Declaration
public void InsertRange(int index, IEnumerable<T> items)
Parameters
Type Name Description
int index

Index to insert at.

IEnumerable<T> items

The list of items to insert.

Exceptions
Type Condition
ArgumentOutOfRangeException

Thrown when the index is less than 0, or greater than/equal to the Count

| Edit this page View Source

Remove(int)

Function to remove an item at the specified index.

Declaration
public void Remove(int index)
Parameters
Type Name Description
int index

Index of the item to remove.

| 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

IGorgonNamedObjectList<T>
IList<T>
ICollection<T>
IGorgonNamedObjectReadOnlyList<T>
IReadOnlyList<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>>)
GorgonIReadOnlyListExtensions.Contains<T>(IReadOnlyList<T>, T)
GorgonIReadOnlyListExtensions.CopyTo<T>(IReadOnlyList<T>, T[])
GorgonIReadOnlyListExtensions.FirstIndexOf<T>(IReadOnlyList<T>, Predicate<T>)
GorgonIReadOnlyListExtensions.IndexOf<T>(IReadOnlyList<T>, T)
GorgonIReadOnlyListExtensions.LastIndexOf<T>(IReadOnlyList<T>, Predicate<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