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
T
Type of manageable instances.
TM
Type 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
manager
TM
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
action
Action<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
plugin
IPlugin
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
required
bool
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
typeName
stringmanageable
IManageablecheckAssignable
bool
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
type
Typemanageable
IManageablecheckAssignable
bool
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
manageable
TX
Returns
Type Parameters
TX
Remove<TX>(IPlugin)
Remove an object from the source.
public abstract void Remove<TX>(IPlugin plugin) where TX : T
Parameters
plugin
IPlugin
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
plugin
IPluginobj
TX
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
selector
Func<KeyValuePair<Type, T>, T>
Returns
- IEnumerable<T>