Class TypeMapManagerSource<T, TM>
A manager source that uses a type map to manage instances of IManageable<T>.
public class TypeMapManagerSource<T, TM> : ManagerSource<T, TM>, IManagerSource<T, TM>, IManagerSource, ITypeSource<T>, ITypeSource where T : class, IManageable<TM> where TM : class, IManager
Type Parameters
TThe type of manageable objects, which must implement IManageable<T>.
TMThe type of manager, which must implement IManager.
- Inheritance
-
ManagerSource<T, TM>TypeMapManagerSource<T, TM>
- Implements
-
IManagerSource<T, TM>ITypeSource<T>
- Inherited Members
- Extension Methods
Properties
Log
protected override Logger Log { get; }
Property Value
Methods
Add<TX>(IPlugin, bool)
Add an object to the source of the type TX.
public override TX? Add<TX>(IPlugin plugin, bool failIfExists = true) where TX : T
Parameters
Returns
- TX
Type Parameters
TX
Add<TX>(IPlugin, TX, bool)
Add an object to the source.
public override void Add<TX>(IPlugin plugin, TX obj, bool failIfExists = true) where TX : T
Parameters
Type Parameters
TX
Count()
Get the count of objects in the source.
public override int Count()
Returns
ForEach(Action<T>)
Get an object from the source.
public override void ForEach(Action<T> action)
Parameters
actionAction<T>
Get(Type, bool)
Get an object from the source.
public override T? Get(Type type, bool required = true)
Parameters
Returns
- T
GetList()
Get all objects from the source.
public override List<T> GetList()
Returns
- List<T>
GetManagedInfo()
Get information about the managed instances.
public override string GetManagedInfo()
Returns
GetOrCreate<TX>(IPlugin)
Get an object from the source or create and add if not.
public override TX GetOrCreate<TX>(IPlugin plugin) where TX : T
Parameters
pluginIPlugin
Returns
- TX
Type Parameters
TX
Get<TX>(bool)
Get an object from the source.
public override TX? Get<TX>(bool required = true) where TX : T
Parameters
requiredbool
Returns
- TX
Type Parameters
TX
Has(string, out IManageable?, bool)
Do we have a manageable of a type name.
public override bool Has(string typeName, out IManageable? manageable, bool checkAssignable = true)
Parameters
typeNamestringmanageableIManageablecheckAssignablebool
Returns
Has(Type, out IManageable, bool)
Do we have an object of the type TX in the source.
public override bool Has(Type type, out IManageable manageable, bool checkAssignable = true)
Parameters
typeTypemanageableIManageablecheckAssignablebool
Returns
Has<TX>(out TX)
Do we have an object of the type TX in the source.
public override bool Has<TX>(out TX manageable) where TX : T
Parameters
manageableTX
Returns
Type Parameters
TX
Remove<TX>(IPlugin)
Remove an object from the source.
public override void Remove<TX>(IPlugin plugin) where TX : T
Parameters
pluginIPlugin
Type Parameters
TX
Select(Func<KeyValuePair<Type, T>, T>)
Select an enumerable of objects from the source.
public override IEnumerable<T> Select(Func<KeyValuePair<Type, T>, T> selector)
Parameters
selectorFunc<KeyValuePair<Type, T>, T>
Returns
- IEnumerable<T>