Class Manager<TItem, TInstance>
Manager.
Inheritance
Inherited Members
Namespace: Terrasoft.Core
Assembly: Terrasoft.Core.dll
Syntax
public abstract class Manager<TItem, TInstance> : IManager<TItem, TInstance>, IManager where TItem : class, IManagerItem<TInstance>, IManagerItem where TInstance : class
Type Parameters
Name | Description |
---|---|
TItem | The class implementing the IManagerItem interface. |
TInstance | Any type. |
Constructors
Manager()
Declaration
protected Manager()
Properties
ItemCount
Number of items.
Declaration
public int ItemCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Items
Collection of the manager items.
Declaration
protected virtual ManagerItemCollection<TItem> Items { get; set; }
Property Value
Type | Description |
---|---|
ManagerItemCollection<TItem> |
Name
Name.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Provider
The provider.
Declaration
public ManagerProvider Provider { get; set; }
Property Value
Type | Description |
---|---|
ManagerProvider |
Methods
Add(TItem)
Adds a new manager item to the end of the collection.
Declaration
public void Add(TItem item)
Parameters
Type | Name | Description |
---|---|---|
TItem | item | The item that is added to the collection. |
Clear()
Removes all items from the collection of the manager.
Declaration
public virtual void Clear()
ClearItems(Object, EventArgs)
Removes all items in the collection of the manager items.
Declaration
protected virtual void ClearItems(object sender, EventArgs eventArgs)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | Reference to the entity that initialized the deleting. |
System.EventArgs | eventArgs | Arguments of the item deleting event. |
CreateItemCollection()
Creates the collection of manager items of the IManagerItem type.
Declaration
protected abstract IManagerItemCollection<IManagerItem> CreateItemCollection()
Returns
Type | Description |
---|---|
IManagerItemCollection<IManagerItem> | Collection of the manager items of the IManagerItem type. |
FindInstanceByName(String)
Searches for the instance of the manager item with the specified name.
Declaration
public virtual TInstance FindInstanceByName(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the manager item instance to get. |
Returns
Type | Description |
---|---|
TInstance | The instance of the manager item with the |
FindInstanceByUId(Guid)
Gets the instance of the manager item for the specified unique identifier.
Declaration
public virtual TInstance FindInstanceByUId(Guid uid)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | uid | Unique identifier of the manager item instance. |
Returns
Type | Description |
---|---|
TInstance | The instance of the manager item with the specified |
FindItem(Predicate<TItem>)
Searches for the manager item by predicate match.
Declaration
public virtual TItem FindItem(Predicate<TItem> match)
Parameters
Type | Name | Description |
---|---|---|
System.Predicate<TItem> | match | Predicate to search with. |
Returns
Type | Description |
---|---|
TItem | Found manager item. |
FindItemByCaption(String)
Searches for the manager item with the specified header.
Declaration
public virtual TItem FindItemByCaption(string caption)
Parameters
Type | Name | Description |
---|---|---|
System.String | caption | Header of the manager item. |
Returns
Type | Description |
---|---|
TItem | The manager item of the current type with the |
FindItemByName(String)
Searches for the manager item with the specified name.
Declaration
public virtual TItem FindItemByName(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The manager item name. |
Returns
Type | Description |
---|---|
TItem | The manager item of the current type with the |
FindItemByUId(Guid)
Searches for the manager item of the current type with the specified unique identifier.
Declaration
public virtual TItem FindItemByUId(Guid uid)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | uid | Unique identifier of the manager item to get. |
Returns
Type | Description |
---|---|
TItem | The manager item of the current type with the unique |
GetInstanceByName(String)
Gets the instance of the manager item with the specified name.
Declaration
public virtual TInstance GetInstanceByName(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the manager item instance. |
Returns
Type | Description |
---|---|
TInstance | The instance of the manager item with the |
GetInstanceByUId(Guid)
Gets the instance of the manager item with the specified unique identifier.
Declaration
public virtual TInstance GetInstanceByUId(Guid uid)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | uid | Unique identifier of the manager item instance. |
Returns
Type | Description |
---|---|
TInstance | The instance of the manager item with the specified |
GetItemByName(String)
Gets the manager item with the specified name.
Declaration
public virtual TItem GetItemByName(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The manager item name. |
Returns
Type | Description |
---|---|
TItem | The manager item of the generic type with the |
GetItemByUId(Guid)
Gets the manager item with the specified identifier.
Declaration
public virtual TItem GetItemByUId(Guid uid)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | uid | Unique identifier of the manager item. |
Returns
Type | Description |
---|---|
TItem | The manager item of the current type with the unique |
GetItems()
Gets an enumerator of the manager items of the current type.
Declaration
public virtual IEnumerable<TItem> GetItems()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<TItem> | The enumerator of the manager items of the current type. |
GetItems(Predicate<IManagerItem>)
Gets an enumerator of the manager items that match the specified criteria.
Declaration
public virtual IEnumerable<IManagerItem> GetItems(Predicate<IManagerItem> match)
Parameters
Type | Name | Description |
---|---|---|
System.Predicate<IManagerItem> | match | Criteria that should be matched by the return enumeration members. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IManagerItem> | The enumerator of the manager items that match the |
Initialize(ManagerProvider, ManagerProviderConfigurationElement)
Initializes the schema manager, using the specified manager provider and the information from the configuration file.
Declaration
public virtual void Initialize(ManagerProvider provider, ManagerProviderConfigurationElement configuration)
Parameters
Type | Name | Description |
---|---|---|
ManagerProvider | provider | The manager provider. |
ManagerProviderConfigurationElement | configuration | Information from the configuration file. |
InitializeAllItemCollection(IManagerItemCollection<IManagerItem>)
Initializes the collection of manager items.
Declaration
protected virtual void InitializeAllItemCollection(IManagerItemCollection<IManagerItem> items)
Parameters
Type | Name | Description |
---|---|---|
IManagerItemCollection<IManagerItem> | items | The collection of manager items to be initialized. |
InitializeInstance(TItem)
Creates an instance of the specified manager item.
Declaration
protected abstract TInstance InitializeInstance(TItem item)
Parameters
Type | Name | Description |
---|---|---|
TItem | item | The manager item whose instance is being created. |
Returns
Type | Description |
---|---|
TInstance | The instance of the |
InitializeSafeInstance(TItem)
Creates a safe instance of the specified manager item.
Declaration
protected abstract TInstance InitializeSafeInstance(TItem item)
Parameters
Type | Name | Description |
---|---|---|
TItem | item | The manager item whose safe instance is being created. |
Returns
Type | Description |
---|---|
TInstance | The safe instance of the |
Remove(TItem)
Removes the specified item from the collection of the manager items.
Declaration
public bool Remove(TItem item)
Parameters
Type | Name | Description |
---|---|---|
TItem | item | The item to be removed from the collection. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Explicit Interface Implementations
IManager.FindInstanceByName(String)
Searches for the instance of the manager item with the specified name.
Declaration
object IManager.FindInstanceByName(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the manager item instance to get. |
Returns
Type | Description |
---|---|
System.Object | The instance of the manager item with the |
IManager.FindInstanceByUId(Guid)
Searches for the instance of the manager item with the specified unique identifier.
Declaration
object IManager.FindInstanceByUId(Guid uid)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | uid | Unique identifier of the manager item instance to get. |
Returns
Type | Description |
---|---|
System.Object | The instance of the manager item with the specified |
IManager.FindItemByName(String)
Searches for the manager item with the specified name.
Declaration
IManagerItem IManager.FindItemByName(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The manager item name. |
Returns
Type | Description |
---|---|
IManagerItem | The manager item of the IManagerItem type with the |
IManager.FindItemByRealUId(Guid)
Returns the manager item by its schema extension unique identifier or null
if item not found.
Declaration
IManagerItem IManager.FindItemByRealUId(Guid itemUId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | itemUId | Schema extension unique identifier. |
Returns
Type | Description |
---|---|
IManagerItem | Schema manager item or |
IManager.FindItemByUId(Guid)
Searches for the manager item with the specified unique identifier.
Declaration
IManagerItem IManager.FindItemByUId(Guid uid)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | uid | Unique identifier of the manager item to get. |
Returns
Type | Description |
---|---|
IManagerItem | The manager item of the IManagerItem type with the unique |
IManager.GetInstanceByName(String)
Gets the instance of the manager item with the specified name.
Declaration
object IManager.GetInstanceByName(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the instance of the manager item with the |
Returns
Type | Description |
---|---|
System.Object | The instance of the manager item with the |
IManager.GetInstanceByUId(Guid)
Gets the instance of the manager item with the specified unique identifier.
Declaration
object IManager.GetInstanceByUId(Guid uid)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | uid | Unique identifier of the manager item instance. |
Returns
Type | Description |
---|---|
System.Object | The instance of the manager item with the specified |
IManager.GetItemByName(String)
Gets the manager item with the specified name.
Declaration
IManagerItem IManager.GetItemByName(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The manager item name. |
Returns
Type | Description |
---|---|
IManagerItem | The manager item of the IManagerItem type with the |
IManager.GetItemByRealUId(Guid)
Returns the manager item for the specified unique schema extension identifier.
Declaration
IManagerItem IManager.GetItemByRealUId(Guid itemUId)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | itemUId | Unique identifier of the schema extension. |
Returns
Type | Description |
---|---|
IManagerItem | Manager item for the schema extension with the unique identifier. |
IManager.GetItemByUId(Guid)
Gets the manager item with the specified identifier.
Declaration
IManagerItem IManager.GetItemByUId(Guid uid)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | uid | Unique identifier of the manager item. |
Returns
Type | Description |
---|---|
IManagerItem | The manager item of the IManagerItem type with the unique |
IManager.GetItems()
Gets an enumerator of items of the manager.
Declaration
IEnumerable<IManagerItem> IManager.GetItems()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IManagerItem> | The enumerator of items of the manager. |