Class ManagerItemCollection<TItem>
Collection of the manager items.
Inheritance
Implements
Inherited Members
Namespace: Terrasoft.Core
Assembly: Terrasoft.Core.dll
Syntax
public class ManagerItemCollection<TItem> : Collection<TItem>, IList<TItem>, ICollection<TItem>, IList, ICollection, IReadOnlyList<TItem>, IReadOnlyCollection<TItem>, IEnumerable<TItem>, IManagerItemCollection<IManagerItem>, IEnumerable where TItem : class, IManagerItem
Type Parameters
Name | Description |
---|---|
TItem | Type implementing the IManagerItem interface. |
Constructors
ManagerItemCollection()
Declaration
public ManagerItemCollection()
Properties
ItemCount
Number of items in the collection.
Declaration
public int ItemCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
Check(TItem)
Checks for the specified manager item in the current collection.
Declaration
public virtual void Check(TItem item)
Parameters
Type | Name | Description |
---|---|---|
TItem | item | The item to check for. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If the |
FindByName(String)
Searches collection element of the current type by given name.
Declaration
public TItem FindByName(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the collection element. |
Returns
Type | Description |
---|---|
TItem | Collection element of the current type with name |
Exceptions
Type | Condition |
---|---|
ArgumentNullOrEmptyException | Rises if the value of the |
FindByUId(Guid)
Searches collection element of the current type by given identifier.
Declaration
public TItem FindByUId(Guid uid)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | uid | Unique identifier of the collection element. |
Returns
Type | Description |
---|---|
TItem | Collection element of the current type with unique identifier |
GetByName(String)
Gets the collection item of the current type with the specified name.
Declaration
public TItem GetByName(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the collection item to get. |
Returns
Type | Description |
---|---|
TItem | The collection item of the current type with the |
Exceptions
Type | Condition |
---|---|
ItemNotFoundException | If an element with the |
GetByUId(Guid)
Gets the collection item of the current type with the specified unique identifier.
Declaration
public TItem GetByUId(Guid uid)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | uid | Unique identifier of the collection item. |
Returns
Type | Description |
---|---|
TItem | The collection item of the current type with the |
Exceptions
Type | Condition |
---|---|
ItemNotFoundException | If an element with the |
GetItems()
Gets an enumerator of the manager items of the current type.
Declaration
public IEnumerable<TItem> GetItems()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<TItem> | The enumerator of the manager items of the current type. |
GetItems(Predicate<TItem>)
Gets an enumerator of the manager items of the current type.
Declaration
public IEnumerable<TItem> GetItems(Predicate<TItem> match)
Parameters
Type | Name | Description |
---|---|---|
System.Predicate<TItem> | match |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<TItem> | The enumerator of the manager items of the current type. |
RemoveAllItemsByUId(Guid)
Removes all items with the specified unique identifier from the current collection of manager items.
Declaration
public void RemoveAllItemsByUId(Guid uid)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | uid | Unique identifier of the items to remove. |
Exceptions
Type | Condition |
---|---|
ItemNotFoundException | If an elements with the |
RemoveItemByName(String)
Removes the first occurrence of an item with the specified name from the current collection of manager items.
Declaration
public void RemoveItemByName(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the item to remove. |
Exceptions
Type | Condition |
---|---|
ItemNotFoundException | If an element with the |
RemoveItemByUId(Guid)
Deletes the first occurrence of an element with the specified unique identifier from the current collection of manager elements.
Declaration
public void RemoveItemByUId(Guid uid)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | uid | Unique identifier of the item to remove. |
Exceptions
Type | Condition |
---|---|
ItemNotFoundException | If an element with the |
Explicit Interface Implementations
IManagerItemCollection<IManagerItem>.FindByName(String)
Searches for the collection item of the IManagerItem type with the specified name.
Declaration
IManagerItem IManagerItemCollection<IManagerItem>.FindByName(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the collection item to get. |
Returns
Type | Description |
---|---|
IManagerItem | The collection item of the current type with the |
Exceptions
Type | Condition |
---|---|
ArgumentNullOrEmptyException | If the empty value or |
IManagerItemCollection<IManagerItem>.FindByUId(Guid)
Searches for the collection item of the IManagerItem type by the specified unique identifier.
Declaration
IManagerItem IManagerItemCollection<IManagerItem>.FindByUId(Guid uid)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | uid | Unique identifier of the collection item to get. |
Returns
Type | Description |
---|---|
IManagerItem | The collection item of the IManagerItem type with the unique |
IManagerItemCollection<IManagerItem>.GetByName(String)
Gets the collection item of the IManagerItem type with the specified name.
Declaration
IManagerItem IManagerItemCollection<IManagerItem>.GetByName(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the collection item to get. |
Returns
Type | Description |
---|---|
IManagerItem | The collection item of the IManagerItem type with the |
IManagerItemCollection<IManagerItem>.GetByUId(Guid)
Gets the collection item of the IManagerItem type with the specified unique identifier.
Declaration
IManagerItem IManagerItemCollection<IManagerItem>.GetByUId(Guid uid)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | uid | Unique identifier of the collection item. |
Returns
Type | Description |
---|---|
IManagerItem | The collection item of the IManagerItem type with the unique |
Exceptions
Type | Condition |
---|---|
ItemNotFoundException | If an element with the |
IManagerItemCollection<IManagerItem>.GetItems()
Gets an enumerator of items of the manager.
Declaration
IEnumerable<IManagerItem> IManagerItemCollection<IManagerItem>.GetItems()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IManagerItem> | The enumerator of items of the manager. |
IManagerItemCollection<IManagerItem>.GetItems(Predicate<IManagerItem>)
Gets an enumerator of the manager items that match the specified criteria.
Declaration
IEnumerable<IManagerItem> IManagerItemCollection<IManagerItem>.GetItems(Predicate<IManagerItem> match)
Parameters
Type | Name | Description |
---|---|---|
System.Predicate<IManagerItem> | match | Criteria that should be matched by the return manager items. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IManagerItem> | The enumerator of the manager items that match the |