Class ManagerSource<T, TM>
Represents a source of managers that can manage instances of type T.
public abstract class ManagerSource<T, TM> : IManagerSource<T, TM>, IManagerSource, ITypeSource<T>, ITypeSource where T : class, IManageable<TM> where TM : class, IManager
Type Parameters
TType of manageable instances.
TMType of the manager that manages instances of type T.
- Inheritance
-
ManagerSource<T, TM>
- Implements
-
IManagerSource<T, TM>ITypeSource<T>
- Derived
- Inherited Members
- Extension Methods
Fields
Manager
protected TM? Manager
Field Value
- TM
Properties
Log
protected abstract Logger Log { get; }
Property Value
Methods
Add<TX>(IPlugin, bool)
Add an object to the source of the type TX.
public virtual TX? Add<TX>(IPlugin plugin, bool failIfExists = true) where TX : T
Parameters
Returns
- TX
Type Parameters
TX
Add<TX>(IPlugin, Type, bool)
Get an object from the source.
public TX Add<TX>(IPlugin plugin, Type type, bool failIfExists = true) where TX : IManageable
Parameters
Returns
- TX
Type Parameters
TX
Add<TX>(IPlugin, TX, bool)
Add an object to the source.
public virtual void Add<TX>(IPlugin plugin, TX obj, bool failIfExists = true) where TX : T
Parameters
Type Parameters
TX
AssignManager(TM)
public void AssignManager(TM manager)
Parameters
managerTM
Count()
Get the count of objects in the source.
public abstract int Count()
Returns
ForEach(Action<T>)
Get an object from the source.
public abstract void ForEach(Action<T> action)
Parameters
actionAction<T>
Get(Type, bool)
Get an object from the source.
public abstract T? Get(Type type, bool required = true)
Parameters
Returns
- T
GetList()
Get all objects from the source.
public abstract List<T> GetList()
Returns
- List<T>
GetManagedInfo()
Get information about the managed instances.
public abstract string GetManagedInfo()
Returns
GetOrCreate<TX>(IPlugin)
Get an object from the source or create and add if not.
public abstract 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 abstract 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 abstract 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 abstract 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 abstract 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 abstract void Remove<TX>(IPlugin plugin) where TX : T
Parameters
pluginIPlugin
Type Parameters
TX
Remove<TX>(IPlugin, TX)
Remove an object from the source.
public virtual void Remove<TX>(IPlugin plugin, TX obj) where TX : T
Parameters
pluginIPluginobjTX
Type Parameters
TX
RequiredType()
Get the type of the object that is required.
public Type RequiredType()
Returns
RequiredTypeName()
Get the name of the type that is required.
public string RequiredTypeName()
Returns
Select(Func<KeyValuePair<Type, T>, T>)
Select an enumerable of objects from the source.
public abstract IEnumerable<T> Select(Func<KeyValuePair<Type, T>, T> selector)
Parameters
selectorFunc<KeyValuePair<Type, T>, T>
Returns
- IEnumerable<T>