Show / Hide Table of Contents

Class ManagerItemCollection<TItem>

Collection of the manager items.

Inheritance
System.Object
System.Collections.ObjectModel.Collection<TItem>
ManagerItemCollection<TItem>
DataValueTypeManagerItemCollection
DBMetaActionManagerItemCollection
LicManagerItemCollection
ProcessSchemaElementManagerItemCollection
SchemaManagerItemCollection<TSchemaManagerSchema>
SystemValueManagerItemCollection
Implements
System.Collections.Generic.IList<TItem>
System.Collections.Generic.ICollection<TItem>
System.Collections.IList
System.Collections.ICollection
System.Collections.Generic.IReadOnlyList<TItem>
System.Collections.Generic.IReadOnlyCollection<TItem>
System.Collections.Generic.IEnumerable<TItem>
IManagerItemCollection<IManagerItem>
System.Collections.IEnumerable
Inherited Members
System.Collections.ObjectModel.Collection<TItem>.Add(TItem)
System.Collections.ObjectModel.Collection<TItem>.Clear()
System.Collections.ObjectModel.Collection<TItem>.CopyTo(TItem[], System.Int32)
System.Collections.ObjectModel.Collection<TItem>.Contains(TItem)
System.Collections.ObjectModel.Collection<TItem>.GetEnumerator()
System.Collections.ObjectModel.Collection<TItem>.IndexOf(TItem)
System.Collections.ObjectModel.Collection<TItem>.Insert(System.Int32, TItem)
System.Collections.ObjectModel.Collection<TItem>.Remove(TItem)
System.Collections.ObjectModel.Collection<TItem>.RemoveAt(System.Int32)
System.Collections.ObjectModel.Collection<TItem>.ClearItems()
System.Collections.ObjectModel.Collection<TItem>.InsertItem(System.Int32, TItem)
System.Collections.ObjectModel.Collection<TItem>.RemoveItem(System.Int32)
System.Collections.ObjectModel.Collection<TItem>.SetItem(System.Int32, TItem)
System.Collections.ObjectModel.Collection<TItem>.System.Collections.IEnumerable.GetEnumerator()
System.Collections.ObjectModel.Collection<TItem>.System.Collections.ICollection.CopyTo(System.Array, System.Int32)
System.Collections.ObjectModel.Collection<TItem>.System.Collections.IList.get_Item(System.Int32)
System.Collections.ObjectModel.Collection<TItem>.System.Collections.IList.set_Item(System.Int32, System.Object)
System.Collections.ObjectModel.Collection<TItem>.System.Collections.IList.Add(System.Object)
System.Collections.ObjectModel.Collection<TItem>.System.Collections.IList.Contains(System.Object)
System.Collections.ObjectModel.Collection<TItem>.System.Collections.IList.IndexOf(System.Object)
System.Collections.ObjectModel.Collection<TItem>.System.Collections.IList.Insert(System.Int32, System.Object)
System.Collections.ObjectModel.Collection<TItem>.System.Collections.IList.Remove(System.Object)
System.Collections.ObjectModel.Collection<TItem>.Count
System.Collections.ObjectModel.Collection<TItem>.Items
System.Collections.ObjectModel.Collection<TItem>.Item[System.Int32]
System.Collections.ObjectModel.Collection<TItem>.System.Collections.Generic.ICollection<TItem>.IsReadOnly
System.Collections.ObjectModel.Collection<TItem>.System.Collections.ICollection.IsSynchronized
System.Collections.ObjectModel.Collection<TItem>.System.Collections.ICollection.SyncRoot
System.Collections.ObjectModel.Collection<TItem>.System.Collections.IList.Item[System.Int32]
System.Collections.ObjectModel.Collection<TItem>.System.Collections.IList.IsReadOnly
System.Collections.ObjectModel.Collection<TItem>.System.Collections.IList.IsFixedSize
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
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 item item is not found in the current collection.

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 name. If element with the name name not found, the default value for the current element type will be returned.

Exceptions
Type Condition
ArgumentNullOrEmptyException

Rises if the value of the name argument is empty or is null.

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 uid. If element with the uid unique identifier not found, the default value for the current element type will be returned.

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 name name. If a item with the name name is not found in the collection, an exception is thrown.

Exceptions
Type Condition
ItemNotFoundException

If an element with the name name is not found in the collection of the manager elements

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 uid unique identifier. If the item with the uid identifier is not found in the collection, an exception is thrown.

Exceptions
Type Condition
ItemNotFoundException

If an element with the uid unique identifier is not found in the collection of the manager elements

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 uid unique identifiers are not found in the current collection of the manager elements

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 name name is not found in the current collection of the manager elements

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 uid unique identifier is not found in the current collection of the manager elements

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 name name. If the item with the name name is not found in the collection, the default value for the current type is returned.

Exceptions
Type Condition
ArgumentNullOrEmptyException

If the empty value or null value is passed as the name parameter.

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 uid identifier. If the item with the uid unique identifier is not found in the collection, the default value is returned for the current type of the manager item.

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 name name.

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 uid identifier. If the item with the uid identifier is not found in the collection, an exception is thrown.

Exceptions
Type Condition
ItemNotFoundException

If an element with the uid unique identifier is not found in the collection of the manager elements

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 match criteria.

Implements

System.Collections.Generic.IList<T>
System.Collections.Generic.ICollection<T>
System.Collections.IList
System.Collections.ICollection
System.Collections.Generic.IReadOnlyList<T>
System.Collections.Generic.IReadOnlyCollection<T>
System.Collections.Generic.IEnumerable<T>
IManagerItemCollection<TItem>
System.Collections.IEnumerable

Extension Methods

CollectionUtilities.AddRange<T>(ICollection<T>, IEnumerable<T>)
CollectionUtilities.RemoveRange<T>(ICollection<T>, IEnumerable<T>)
CollectionUtilities.AddIfNotExists<T>(ICollection<T>, T)
CollectionUtilities.AddRangeIfNotExists<T>(ICollection<T>, IEnumerable<T>)
CollectionUtilities.Find<T>(IEnumerable<T>, Predicate<T>)
CollectionUtilities.Find<T>(IEnumerable<T>, Predicate<T>, T)
CollectionUtilities.ForEach<T>(IEnumerable<T>, Action<T>)
CollectionUtilities.ForEach<T>(IEnumerable<T>, Predicate<T>, Action<T>)
CollectionUtilities.ForEachAsync<T>(IEnumerable<T>, Func<T, Task>)
CollectionUtilities.ParallelForEachAsync<T>(IEnumerable<T>, Func<T, Task>)
CollectionUtilities.ParallelForEachAsync<T>(IEnumerable<T>, Func<T, Task>, Int32)
CollectionUtilities.GetItemsString<T>(IEnumerable<T>)
CollectionUtilities.GetItemsString<T>(IEnumerable<T>, String)
CollectionUtilities.SplitOnChunks<T>(IEnumerable<T>, Int32)
CollectionUtilities.SplitOnParts<T>(IEnumerable<T>, Int32)
CollectionUtilities.IsNotEmpty(IEnumerable)
CollectionUtilities.IsEmpty(IEnumerable)
CollectionUtilities.IsNullOrEmpty(IEnumerable)
CollectionUtilities.IsNotNullOrEmpty(IEnumerable)
CollectionUtilities.CompareZip<TFirst, TSecond>(IEnumerable<TFirst>, IEnumerable<TSecond>, Func<TFirst, TSecond, Boolean>)
CollectionUtilities.Except<T>(IEnumerable<T>, IEnumerable<T>, Func<T, T, Boolean>)
CollectionUtilities.TryGetItemByIndex<TItem>(Collection<TItem>, Int32, out TItem)
CollectionUtilities.Compare<TSource>(IEnumerable<TSource>, IEnumerable<TSource>)
ReflectionUtilities.GetPropertyValue(Object, String)
ReflectionUtilities.GetPropertyDefValue(Object, String, Object)
ReflectionUtilities.TryGetPropertyValue(Object, String, out Object)
ReflectionUtilities.HasProperty(Object, String)
ReflectionUtilities.GetPropertyValue(Object, String, BindingFlags)
ReflectionUtilities.GetPropertyValueByPath(Object, String)
ReflectionUtilities.SetPropertyValue(Object, String, Object)
ReflectionUtilities.TrySetPropertyValue(Object, String, Object)
ValidateUtilities.CheckArgumentNull(Object, String)
ValidateUtilities.CheckDependencyNull(Object, String)
ValidateUtilities.CheckArgumentNullOrEmpty<T>(IEnumerable<T>, String)
ValidateUtilities.EnsureDependencyNotNull<T>(T, String)
MetaDataTestUtils.MetaPropertiesShouldNotHaveDefValue<TInstance>(TInstance)
MetaDataTestUtils.MetaPropertiesShouldNotHaveDefValue<TInstance>(TInstance, Boolean)
NSubstituteExtension.Protected(Object, String, Object[])
NSubstituteExtension.Protected(Object, String, Boolean, Object[])
NSubstituteExtension.ProtectedGeneric<T>(Object, String, Object[])
NSubstituteExtension.ProtectedGeneric<T>(Object, String, Boolean, Object[])
NSubstituteExtension.ProtectedProperty(Object, String)
NSubstituteExtension.MatchInstance<T>(T)
SubstituteUtilities.GetIsSubstituteObject(Object)
SubstituteUtilities.Instead<TInstance, TValue>(TInstance, Func<TInstance, TValue>)
Back to top Generated by DocFX